n-tier applications in Jade
Posted: Fri Aug 07, 2009 11:28 am
by PWCDEMO >> Thu, 29 Aug 2002 2:33:06 GMT
Hi,
I am trying to separate business logic from the Presentation layer and the ModelEntities. I have looked at the SessionBean pattern used in J2EE/EJB and adapted it to Jade as follows.
The use of additional layers makes the application much more maintainable and flexible. And makes the code within it more reusable.
I have created a PublicFacade class (can be sub-grouped using subclasses) and created one method for each external use case that is available to an interface (either user interface or application interface (using app-to-app comms)).
If two or more PublicFacade methods share the same piece of code I put it in a class called ComponentFacade... although this level could be implemented as a set of 'Manager' objects.
When a distrubuted (across multiple objects) transaction needs to occur, I have a TransactionFacade class with these transaction methods in it. The TransactionFacade class is similar to the TransactionAgent class. Each method has an agent (to handle begin, commit, abort) and a block (to handle locking and logic).
The basic flow is one of:
Interface -> PublicFacade -> Objects
Interface -> PublicFacade -> ComponentFacade -> Objects
Interface -> PublicFacade -> TransactionFacade -> Objects
Interface -> PublicFacade -> ComponentFacade -> TransactionFacade -> Objects
There are more details I could go into, but I'll wait to see if anyone has experimented with this before and/or wants to talk about this.
I look forward to the replies.
- Chris
Hi,
I am trying to separate business logic from the Presentation layer and the ModelEntities. I have looked at the SessionBean pattern used in J2EE/EJB and adapted it to Jade as follows.
The use of additional layers makes the application much more maintainable and flexible. And makes the code within it more reusable.
I have created a PublicFacade class (can be sub-grouped using subclasses) and created one method for each external use case that is available to an interface (either user interface or application interface (using app-to-app comms)).
If two or more PublicFacade methods share the same piece of code I put it in a class called ComponentFacade... although this level could be implemented as a set of 'Manager' objects.
When a distrubuted (across multiple objects) transaction needs to occur, I have a TransactionFacade class with these transaction methods in it. The TransactionFacade class is similar to the TransactionAgent class. Each method has an agent (to handle begin, commit, abort) and a block (to handle locking and logic).
The basic flow is one of:
Interface -> PublicFacade -> Objects
Interface -> PublicFacade -> ComponentFacade -> Objects
Interface -> PublicFacade -> TransactionFacade -> Objects
Interface -> PublicFacade -> ComponentFacade -> TransactionFacade -> Objects
There are more details I could go into, but I'll wait to see if anyone has experimented with this before and/or wants to talk about this.
I look forward to the replies.
- Chris