Building your Presentation with Classes

Posted by jatt on 19-Feb-2008 23:55

1 - Is there any sample code for this part of OERA (presentation layer). I think this is more hard to understand part of OERA.

2 - When presentation layer consist two type of subject (customers, orders) the start program (startup.p in ClassBasedOERA) should consist instantiation of class type customer - becustomer (and sent its handle to presenter), next instantiation of class type order - beorder sent its handle to presenter and wait-for close presentation window,

or

better idea is make business entity becustord with dataset consist customer and his order?

I think that the second eventuality is less scalable and less reusable.

In the presentaion Building Presentaion with Clases is this statement

clsCbcCustomer = NEW samples.cbcCustomerMaintenance().

but there aren't described this class

Message was edited by:

Jaroslav TURON

All Replies

Posted by svi on 21-Feb-2008 16:13

I think this can help you if you have not seen it already:

ARCH-11: Building Your Presentation with Classes

http://www.psdn.com/library/entry.jspa?externalID=3277&categoryID=1379

OpenEdge® Application Example - Presentation

http://www.psdn.com/library/kbcategory.jspa?categoryID=300

Posted by Thomas Mercer-Hursh on 21-Feb-2008 16:37

There are always some tradeoffs in OO design. It all reminds me a bit of exchanges I used to have about taxonomy on the difference between "lumpers" and "splitters". In this case, the splitter end of things would like to divide every piece of data and logic down into its smallest possible aggregate so that there is no possibility of duplication of logic in any sense. Nice idea, but with practical issues. At the other end one has the lumpers who try to put the maximum amount of logic in each object so that not only does the basic idea of customer contain the concept of all orders of that customer, but one has perversions such as inventory items which order themselves. Neither is practical in the extreme.

One of the issues here is that the contents of any one object can vary according to domain. E.g., to a marketing organization, a customer is a name, address, and some information about type of industry, size of company, purchase history, etc., but to an order entry context it involves alternate ship-tos, current order(s), credit, etc. Lumping all possible aspects of customer into a single object is not practical.

Similarly, one wants to think about orders in very different ways depending on context. In one case we have the information about a single order. In another we have all orders ready for shipment. In yet another we have all orders for a particular item. And so forth.

I think this requires some finesse in design. There are also practical consideration such as, in a 3GL OO environment the historically natural thing to do with a set of orders was to put them into some form of collection object, i.e., one object which contains a set of other objects. Currently, this has some issues in ABL (although, see http://www.oehive.org/CollectionClasses ) and it clearly is not making optimum use of ABL 4GL constructs like temp-tables and ProDataSets.

Consequently, what I am currently advocating is a mixed approach. E.g., one creates one object for Customer, one for Order, and possibly one for CustomerOrders (one or more). The Customer object is pure properties, unless it includes a temp-table of alternate addresses or some such. The Order object has properties for the order overall and a temp-table or PDS for the lines. There is also an entity object for the OrderLine which might be all properties. The CustomerOrders class is inherently a "set object", but it is not a generic one. It contains a PDS structured to hold the combination of customer and orders. But, this set object has methods which will deliver a Customer object or a Set object to some process that needs to manipulate them and it could even cast one element of the PDS into a class for some internal processing, thus keeping that processing logic in one place. I.e., one of the goals here is to partition the properties and logic so that there are properties and logic of the individual entity object and other properties and logic of the set, hopefully without overlap.

It all still needs exploring, but this is where I am today. HTH.

Posted by fbe on 22-Feb-2008 02:25

Posted by jatt on 22-Feb-2008 04:01

ARCH-11 is excellent starting materials, but sample code will be better to understand how is the hierarchy of client presentation classes and how they communicate with viewer. So I will be pleased to obtain some information.

I think that OpenEdge® Application Example - Presentation is not about OOP but is good too.

The idea from TMH is very interesting - thank.

Posted by fbe on 22-Feb-2008 04:10

Message was edited by: Frank C. G. Beusenberg

Posted by fbe on 22-Feb-2008 07:53

BTW the provided link pops up a Certificate issue, just click the continue option to get to the resources.

Posted by jatt on 25-Feb-2008 00:20

Thank for link to sample code. I upload it and it will be basic for study together with Building_Presentation_with_Classes.ppt.

Posted by olivier.dunemann on 09-Oct-2009 03:11

Hi there,

I'm desperatly looking at the here-above related sample code.

It doesn't seem to be available in the "Progress Communities" nor accessible on the "projects2progress" site.

Could someone give me some help?

Thank you in advance.

Posted by agent_008_nl on 17-Mar-2010 04:11

Same here, is the code available sowhere else then on https://www.projects4progress.com/repos/projects/pro nowadays?

--

Kind regards,

Stefan Houtzager

Houtzager ICT consultancy & development

www.linkedin.com/in/stefanhoutzager

Posted by Mike Ormerod on 17-Mar-2010 14:45

I'll see if I can find the original code.  I'm not sure why it got lost in the first place!!

This thread is closed