Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / January 2005

Tip: Looking for answers? Try searching our database.

Session facade vs Command pattern

Thread view: 
kelly - 18 Jan 2005 18:38 GMT
Hello,

I am debating using the Command pattern as my primary strategy for
implementing my enterprise app business logic. The general idea is to
have only a few types of abstract commands (with various types of
transactional integrity) and implement each use case as a command. The
result of my design will be a very small set of stateless session beans
with an execute() interface. No entity beans (will use Hibernate) and
may very well eventually implement a Message bean interface with a
similar executeAsynchronously() type method, if eventually necessary.

I guess the popular alternative (or, more correctly, the norm) is to
implement session facades for this.

However, I am attracted to the Command pattern because of its
simplicity, it's rapid application development angle, its
disconnected-ness from EJB (e.g., a modification to a command does not
mean touching any EJB at all, just the command class), and the ability
for implementing cross-cutting features (such as transactions or
security, although I also plan to use an AOP solution at the POJO
level).  At the same time, it works as a delegate of an EJB, so it's
accessible for all kinds of network clients.

I am also familiar with it's drawbacks (e.g., maintainability for large
numbers of commands, per the literature, such as the Marinescu 2002 EJB
Patterns book).

So, very few stateless session beans -- mainly there for remote client
acceessibility and the ability to leverage application-level
transactions if needed.

Nevertheless, I have never tried the command pattern approach and was
curious if others had feedback or case studies.

Best regards --
Michiel Konstapel - 18 Jan 2005 21:16 GMT
> Hello,
>
[quoted text clipped - 29 lines]
> Nevertheless, I have never tried the command pattern approach and was
> curious if others had feedback or case studies.

Just my quick 2 cents: we use the same approach in our application (except  
we do use entity beans) and so far, we've been very happy with it,  
precisely because of the reasons you mentioned. We probably have about  
fifty to a hundred commands and maintainability is no problem at all, if  
you have a good package structure.
HTH,
Michiel


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.