September 09, 2009

OpenEdge Architect videos on Communities

Posted by John Sadd

With Exchange Online 2009 coming right up (September 15-17) I wanted to remind people of the availability of a set of introductory videos that cover a lot of the basic topics related to using OpenEdge Architect. They're all available directly from the OpenEdge home page on the PSDN area of Progress Communities:

http://communities.progress.com/pcom/community/psdn/openedge

There's a landing page for five introductory videos to get you started using Architect for the first time, covering topics such as creating your first Architect workspace and project, defining database connections for your workspace, setting project properties, building and running your project, and using the ABL Editor that's a central part of the value of developing in OpenEdge Architect. That page is here:

http://communities.progress.com/pcom/docs/DOC-101140

And then there's a continuing series of topics that go beyond the Getting Started series covering subjects such as defining and using perspectives and views, maintaining structured procedures created in the AppBuilder, using the ABL Debugger, and various more advanced features of the ABL Editor. Those sessions are all available here:

http://communities.progress.com/pcom/docs/DOC-101504

The videos are designed to be fairly self-contained, so that you can view what's of interest to you, though there is a recommended sequence to them that's indicated by their organization on the site. And they're kept to around seven or eight minutes each so that you're not overwhelmed with content and can try out what you've learned in each video before proceeding.

We're very interested in your feedback both on this specific set of presentations and on the general format that they use. We're already creating new video series, some accompanied by documents with text and code samples, to help you get started with other major parts of OpenEdge 10, including the support for classes and the GUI for .NET. Keep us posted on your comments and recommendations.

June 18, 2008

OpenEdge and the Not-Quite-Accidental Architecture

Posted by John Sadd

We’ve been talking for a long time now about the OpenEdge Reference Architecture (see a host of definitional and example materials at www.psdn.com under the new Service Oriented Business Application Expertise Center). The OERA is the diagram with the layers from Presentation and Enterprise at the top down through Business Components and Data Access to Data Sources at the bottom. A lot of people at Exchange and elsewhere where we’ve had a chance to connect in person find the discussion stimulating but intimidating. “Thanks for the presentation. I see now how complicated this architecture stuff is now.” Hmmm. That wasn’t exactly the message we were trying to convey. It’s understandable how the layers make it seem like it is going to be harder to implement a well-architected service-oriented application, but the intention is just the opposite: to help you make it easier, not harder, to get your application to where it needs to be for all that loosely-coupled agility that you know you need.

So how does it wind up being easier? I have a couple of simple principles I have been trying to get across in more recent materials:

1. Let each component of your application (a procedure or a class, whatever) do just one job and one type of job.

How many procedures in your application are there that do a whole application operation from soup to nuts, as it were, from user interface to business logic to database transactions? If you can break those up into pieces that do one type of job – user interface, business rules, mapping to database tables, or database transaction – then you’re well on your way to having components you can reuse when you need them, rather than copying and pasting old code into new places and then changing it to suit new circumstances.

2. Do each job once and only once.

And how does this wind up making your development job easier?
Well, how many places are there in your application where the code… – fill in the blank here with your own list of completions to the question: calculates a price, validates the correctness of an order, checks a user ID for access to an application module, joins six related tables in the database, whatever. If you can factor out redundant or similar code for any of these kinds of activities, you’ve certainly simplified your maintenance and testing job, and probably made it simpler to do a related version of the same job the next time you have to.

And where does the not-quite-accidental part of the architecture come in? One of the key messages we could do a better job of communicating is that you don’t have to tackle the whole job at once: the OERA represents a set of guidelines and ideal goals, not an absolute all-or-nothing necessity. So if you think in terms of making your application structure a little bit better each time you change it rather than a little bit worse, then you’re headed in the right direction. And you’ll see that starting in on principle #1 is really a prerequisite to principle #2. If you start breaking out chunks of code based on what one job they do, then it will be much easier to reuse them. Take all those price calculations; factor out the common code and parameterize the variations; create a straightforward API that lets another part of the app call in with needed inputs and get back needed outputs; and eliminate assumptions in the code about the nature of the caller; and voila! – pretty soon you’ve got a Business Component with a Service Interface (that’s the common API part) on the front of it. At that point OpenEdge makes it easy to call that Business Component through the Service Interface from all over, including from other applications and new user interfaces.

Find all the places where your code checks a user ID against permissions on an application module; move them into a single procedure that does that job and call it wherever it’s needed; and voila! – you’ve got the beginnings of Common Infrastructure. So you don’t need to solve the whole problem at once. Just head in a direction that makes it easier for you to identify what all the bits and pieces do, and sooner or later you’ll have an application code that has got a real architecture to it. And think how much easier that will make your life in a world of new UIs and Web services and all the rest of what you have to deal with. Follow the right principles and – not quite accidentally, but pretty close – your application will start to have an architecture after all.

April 29, 2008

Balancing relational data with an object-oriented approach to managing it

Posted by John Sadd

One of the major new areas in OpenEdge 10 is the language support for classes. ABL now lets you define source files as classes, as an alternative to procedures, to take advantage of many valuable object-oriented features established by languages like Java and C#, including inheritance and strong-typing of object references. One major pragmatic value of this new direction is the greater ability it gives you to define within your source code just exactly what things refer to and how different classes are related, so that the compiler can cross-check your references and give you much more feedback on your code's correctness at compile time, rather than waiting until runtime to see whether you've defined all the pieces correctly. So rather than defining a reference to a procedure as a handle variable that could point to anything at all at runtime, you define the variable as a reference to a specific class, and by gosh, the compiler will make sure that every reference to a property or method of that class is correct, and that you don't use that variable to reference anything else. This is a clear advantage to developers, and has little to do with any need for a deep understanding of object orientation.

So far, so good. But one of the major benefits of using ABL as a high-level programming language, as distinct from Java or C#, is the tight integration into the language of business logic that knows how to deal with relational data (and after all, most of the data managed by a business application written in any language is still relational), and that knows the details of the data's schema and lets you program accordingly. This is the key to the value of ABL, and goes all the way back to the language's FOR EACH Customer: DISPLAY Customer beginnings. In today's ABL we support the same kind of data manipulation, whether it's against the physical data schema (the database) or the logical schema of an application (temp-tables and ProDataSets).

This combination of support for classes with its object-oriented approach to code design, juxtaposed with the still very relational view of the business data, poses some serious challenges. Should you now try to treat each data item (a customer, say) as a true object? Does a set of all the customers in Ohio now become a collection of objects, that is, independent running instances of an ABL .r file, each holding the data for a single customer? This kind of approach has been tried in at least a few cases, and seems to go very much against the grain of the relational advantage of being able to treat these customers as an organized table of information, and presents the potential for serious performance problems as well.

There has been work in some areas on balancing the usefulness of a relational table as a way to hold and access multiple objects (like customers in Ohio), while using a more object-oriented approach to represent a single customer object, as properties of a class. See for example this thread on the PSDN Principles and OERA Forum:

http://www.psdn.com/library/thread.jspa?threadID=7645&tstart=0

There is also the question of how to balance what we traditionally describe as 'static' references to tables and fields – taking advantage of the compiler's knowledge of database and temp-table definitions – with the more dynamic approach of using a reference to a set of data (a handle, in this case) as a way to access its tables and fields and values more indirectly, using syntax like httCustomer::CustName, for instance. The static approach requires, at this stage of the product's evolution, having all the table definitions coded (perhaps as include files) in every class or procedure that references them, which is not a very encapsulated, object-oriented way of constructing things. The dynamic approach sacrifices some of the simplicity of the traditional FOR EACH...WHERE coding style along with some of the ability to count on the compiler and other tools to make sure references are correct and efficient.

So in short, we find ourselves in a transition between a more or less strictly procedural way of dealing with more or less strictly relational data, and a much more object-oriented way of dealing with what is mostly that same data. The product itself is always evolving. Future language features and other enhancements, always influenced by the experiences and the requests of our customers, help bring us closer to an ideal of really simplifying the hard job of building successful business applications. Open discussions about best practices, that is, how to do the most effective job of using what the product provides at any given point in time, are also a key component of creating a common understanding of how best to proceed.

I won't attempt any definite answers here. That would turn a blog entry into a full-blown white paper. And the point is, the answers are still in flux, and not as definite as we all would like. But the topic is important, and needs everyone’s input and experiences. There have been a number of threads on the OpenEdge Principles Forum on one aspect or another of the issues around handling relational data as objects, and you should take a look at them. To stimulate a continuing discussion, I've started a thread for comments and discussions on the subject, with this entry as a starting point. Join in. We need the participation of the broader OpenEdge community to help us guide where we go from here with the product, as well as with the discussion of how best to use it and apply its distinct and still considerable value. Here's the link to the thread, just in case you don't yet know your way around the forums:

http://www.psdn.com/library/thread.jspa?threadID=9532

Hope to hear from you.

Progress Software
Progress Software