Advice form the young at heart... Design program closer to

Posted by OctavioOlguin on 05-May-2015 14:46

Greetings all.

I would like  to ask your guidance, as I'm turning all new development on 11,5 to be OERA compatible.  I tested the concept with one window where user can query some dates and stuff of things going on here..  Also made some test on one thing or two as  far as the inteface is involved.  I came to a proof of concept window, but I want to be very certain that it is the best I can get, so I'll expose my current algortihm to hear from the old sea wolves advices... Thanks..

  1. Define one dataset to be throw to appserver to fullfill.
  2. ask the user on uib .w window, parameters for range of dates to query.  Send to appserver.
  3. get the result from appserver in the dataset temp-table.
  4. copy each record of this temp-table to another TT defined in the properties of the window, so I can draw a static browse on uib to show results.
  5. Or otherwise, the DS should be defined after the static TT is defined and even drawed so it can sport the same TT that the browse is based on, and send it to appserver?  I sounds solid.. but...

I wonder how it would be more efficient this process.. Is the dynamic browse a better option?  If it's better, where could I get some samples that would help achieve the best?

All Replies

Posted by Peter Judge on 05-May-2015 15:14

For the back end service/server-side code:
The basic unit is what's called a Business Entity (BE) – this is a dataset + 1-many temp-tables, together with business logic. The dataset represents a logical data structure (so may have nice names like CustomerNumber where a db table has cust-id or worse) which represents a business function (something like a complex screen).
 
IMO, the BE should be capable of being run on without a Db connection. The BE gets its data from a the Data Access layer (which knows about the database and how to map db tables and fields into the BE's dataset/temp-table fields). You can connect to the DA, get or save data, and disconnect from the DA; in some approaches you simply stay connected. The point of this separate DA is that you can change the underlying table or field mapping and have the business logic work unchanged.
 
In 11.5 there's a basic BusinessEntity class in the product that can help with some of the mechanics of getting and updating data.
 
The BE is exposed to a client (even an ABL client) through a service interface (SI). This is a piece of code that knows how to get a request and pass that request on to the BE. So if you get a REST request it knows how to turn the incoming JSON and URL query parameters (say) into something that a BE understands (i.e. a 'for each' statement with where clauses and potentially batch/page sizes). You can have multiple service interfaces talk to a single BE. SI's do a limited set of tasks: transform the inputs and outputs to and from a format the BE understands, finds the BE to run for a particular request, and perform some authentication and/or authorisation.
 
There are a variety of examples on how to build OERA-style BE's (there are two AutoEdge-branded reference sample implementations available of Communities).
 
One of the places where the current OERA (in terms of sample code produced) is lacking, is the UI/Presentation Layer, alas. Most modern UI frameworks use some form of MVP/MVC/MVVM; these all use some Model to provide data to the UI. In ABL this would usually be a dataset/temp-table with some logic.  You can potentially re-use your BE in the client (without, of course, the Data Access layer  connections); you can create a separate set of Model classes to hold those temp-tables too.
 
Whatever approach you choose, though, you should use the data returned from the BE call as-is – I would not recommend copying this data any more.  You use this temp-table schema to bind to your UI.
 
The approach you're taking is generally why people will define the BE's dataset/temp-tables in an include that is used by both client and server components.
 
Hth,
-- peter
 
 
 
 
 
[collapse]
From: OctavioOlguin [mailto:bounce-OctavioOlguin@community.progress.com]
Sent: Tuesday, 05 May, 2015 15:47
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] Advice form the young at heart... Design program closer to OERA
 
Thread created by OctavioOlguin

Greetings all.

I would like  to ask your guidance, as I'm turning all new development on 11,5 to be OERA complaint.  I tested the concept with one window where user can query some dates and stuff of things going on here..  Also made some test on one thing or two as  far as the inteface is involved.  I came to a proof of concept window, but I want to be very certain that it is the best I can get, so I'll expose my current algortihm to hear from the old sea wolves advices... Thanks..

  1. Define one dataset to be throw to appserver to fullfill.
  2. ask the user on uib .w window, parameters for range of dates to query.  Send to appserver.
  3. get the result from appserver in the dataset temp-table.
  4. copy each record of this temp-table to another TT defined in the properties of the window, so I can draw a static browse on uib to show results.
  5. Or otherwise, the DS should be defined after the static TT is defined and even drawed so it can sport the same TT that the browse is based on, and send it to appserver?  I sounds solid.. but...

I wonder how it would be more efficient this process.. Is the dynamic browse a better option?  If it's better, where could I get some samples that would help achieve the best?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by agent_008_nl on 06-May-2015 01:23

I can recommend autoedge thefactory. You would need some time to get it to work and understand how it works. To me it proved a valuable investment of my time. See for an introduction  community.progress.com/.../879.welcome-to-the-complete-autoedge-kit.aspx you can find code at github.com/.../autoedgethefactory

but of course Peter can provide the most useable links. These were quickly grabbed.

  You can see oera as a separation of concerns principle (robertcorvus.com/separation-of-concerns-principle) at a high level. "The value of separation of concerns is simplifying development and maintenance of programs. When concerns are well-separated, individual sections can be reused, as well as developed and updated independently.

Of special value is the ability to later improve or modify one section of code without having to know the details of other sections, and without having to make corresponding changes to those sections."

  Of course oera is not much more than a rebranding of principles described before, outside of the progress world. I have no idea where you can find a white paper going a bit into depth about oera. This paper from outside the psc world could give you an idea: www.ambysoft.com/.../persistenceLayer.pdf (doubtless much more to be googled).  

 So if you separate your application into the layers used in the oera you should be able to switch UI's more easily / connect different UI types simultanuously to your backend. Have different programmers/teams work on different layers more or less independently (using the api of the layer below that for the rest can be regarded as a black box). Allas you will find the progress database, as db type, tightly tied to your dataaccess layer when you use it's propietory (but very handy) query language. But at least only to that layer if you implement the separation well. It would be nice if we could replace the db easy with f.e. an open source db like postgresql.

--

Kind regards,

Stefan Houtzager

Houtzager ICT consultancy & development

www.linkedin.com/in/stefanhoutzager

Posted by OctavioOlguin on 06-May-2015 08:09

I appreciate both answers as being dedicated lot of time to this...

I'll do as told.

Thanks a lot!!!

Posted by Marian Edu on 07-May-2015 00:26

Hey Octavio, doing what you've been told might work but experimenting on your own is at least twice as fun... so whatever floats you boat will do.

Watch out for those many layers out there, if I'm to rant about OERA would say there should be better ways that just passing around datasets - between 2-3 layers on back-end (DA, BE, services) move that to the client and add up some extra topping to the cake on that side :)

I've seen a large number of ISV's going OERA with some sort of desktop UI (fat or webclient, almost the same one might say) and then they just use the same dataset-centric approach when they want to do web/mobile... the excuse is always the same, reuse business logic.

Posted by agent_008_nl on 07-May-2015 04:56

The posts were not telling Octavio what to do, maybe Octavio did not mean what we read?

 But what are these better ways Marian, and is there an exampleframework where those ways can be seen? And why are those ways better, you have any links to more info / discussions?

 I don't know if you know autoedge, but Peter developed an ingenious way to "pass the datasets around":

community.progress.com/.../990.oeri-service-message-infrastructure.aspx

 (some more about autoedge components can be found via community.progress.com/.../default.aspx by the way, Octavio, f.e. aboiut InjectABL).

----------------------------

Searched my pegmail, I suppose you had orm in mind Marian? You already built an alternative or do you still have an excuse? ;-)

Marian Edu via peg.com 11/26/10

Pe 11/26/2010 12:52 PM, Mike Fechner a scris:
>> I'm kinda favouring the ORM approach cause introducing a DL will also
>> take away the database structure and with it the strong-typed data
>> access,
> The "community" is still waiting for a working model of that - also to compare the performance to a ProDataset / Temp-Table based solution.
>
> Do you have something the you can share?
I wish I had, I thought I'll take a break from all that OERA layers and
enjoy the Java beauty for a while but it looks like I'll still need some
data access layer for the 'fake' JDBC proxy I'm playing with... nothing
to share so far though :)

 

> -----Ursprüngliche Nachricht-----
Im Auftrag von Marian Edu
> Gesendet: Freitag, 26. November 2010 08:37
> An: peg@peg.com
> Betreff: Re: AW: What is a DA layer anyway? ( was Re: Betr.: overhead layered application)
>
>
>> And not to forget, that it's the only structure of it's kind that has built in ability to be passed between different tiers. Browsing a list of customer records is a common concern. Data needs to get to the UI.
>>
>> Temp-Tables are not dead. And will not be dead in the next OE release either.
>>
> Definitively, I think we can even get Dr. Hursh to agree on that assert
> unless in a near future release we'll be able to pass real objects
> between tiers and we all switch to the ORM approach :)
>
> While it's true that very often one do need to pack a set of records and
> pass them as a whole (most often for client display) and a 'set
> oriented' fetch do have it's place in a DA layer but there are other
> cases where the temp-table need not to be filled with all required
> records at once and a sequential access is preferred... as for computing
> calculations like total, average, etc. One 'extreme' example of
> performance penalty induced by those dataset oriented DL is 'delete
> cascade' when deleting a record from parent table the DL might need to
> load all corresponding records in child temp-table, delete them on-site
> and save changes to the database as the DL are barely based on get-changes.
>
> I'm kinda favouring the ORM approach cause introducing a DL will also
> take away the database structure and with it the strong-typed data
> access, if it's exactly the same data structure as in the persistence
> layer or it's mapped somehow I won't mind as long as I can 'see' somehow
> what the structure is. However, there are times when the pure object
> approach does not come in handy and the DL should provide a somehow
> lower lever interface (the core part of Hibernate).
>
> --marian
>

 

Posted by OctavioOlguin on 07-May-2015 11:45

Thanks (Stefan) Agent 008.

Yes, you were able to see what I found, I asked for examples, and instead got some fundamental principles.  So I went after AE thefactory  and began there, but I'm seing that It will take me a lot to get where I need to go, as the first lines on reading about thefactory, diverged me to DI and IoC (Dependency injection and Inversion of Control) and will need to land the litle OO I have on ABL territory (I already have "How I learned to love OO " and related videos, white papers, and stuff)....

Also check my next post about BE  "create" and "update" methods.

Posted by agent_008_nl on 07-May-2015 12:02

Instead??!  You have got your pointers to examplecode Octavio, so you got what you asked for. Behind that examplecode are principles. Code without principles you can find on every dunghill. "There is no such thing as a free lunch."  Google for this last sentence, fold your hands, pray and expect a rebirth. ;-)

Good night, S.

This thread is closed