EJB design: Suggessions on using Design patterns
I've decided to do a project on Human Resource using struts,ejb and oracle as database. But I am not sure what are all the design patterns to use. Can anyone suggest me a good design using patterns.
- Posted by: Thomas Philipi
- Posted on: December 26 2005 12:18 EST
Thanks in advance.
- Suggessions on using Design patterns by Rohit Sood on December 26 2005 23:17 EST
- u can use multiple by lokesh pant on December 27 2005 07:58 EST
- Suggessions on using Design patterns by ranji c on December 27 2005 20:40 EST
- Suggessions on using Design patterns by VIJAY KHANNA on December 29 2005 14:59 EST
- Suggessions on using Design patterns - just the necessary by Damiano Altomare on December 30 2005 05:33 EST
This is a rather difficult question to answer.
Generally I have seen people make use of the Session Facade patterns for EJBs - MVC for Struts. depending on the complexity service locator, delegates etc may be used too.
u can break down ur application into different modules (if the requiremnt is big enough) use multiple design pattern depending upon the modules req.
U can use Session Facade where theres rigerous access to database..
for more UI based module and less BL use MVC
Use patterns when you have a problem in hand and you know that using a particular patter would be the better way to solve it.
Dont use patterns for the heck of it.
Since you are using EJBs, that you could make use of patterns as
value object pattern - to pass around composite data( for example a User Object instead of passing around name, id,age,dob etc)
Session Facade - to code your business logic and to reduce call to entities(if at all you use)
DAO - to access database.
Service Locator - to locate your EJBs
Design patterns per say are means to solve common recurring problem by identifying and strategically implementing a proven solution technique.
The following could be a generic design implmentation for a typical architecture.
2. Business Delegate
3. EJB Home factory
4. Service loacator
SERVER (BUSINESS & PERSISTENCE)
1. Session/Message facade
2. Factory (BC Handlers, DTO)
4. Data Accessor
6. Primary key generation (If needed)
7. Service locator
DTO + Service Locator + Session Facade + DAO