A quick and small description of our approach:

The Business logic layer makes use of value beans, which can be retrieved
and
stored through a Data Access Object (DAO) layer. The concrete implementaion 
of that layer can also be easily changed in this way. The class BLXxxx makes

use of the interface DAOXxxx. The get a concrete implementation of a DAO,
the DAOFactory is used DAOFactory.getDaoXxxx(). 

These BL's can also contain calculations / validations between differned
value beans and they can call eachother off course.

Then every allication Swing / Web (Servelts/JSP/Struts) can use the BL
layer.

In this example the DAO use a database, but also other interface coulb be 
connected easily, like Tibco messaging stuff, through a TibcoDAOXxxx class.


+--------+          +--------+           \   
| BLXxxx |          | BLYyyy |            > Business Logic layer
+--------+          +--------+           /   
  |     |            |      |               
  |     |            |      |
  |     |            |      |
  |     V            V      |
  |    +--------------+     |            \   +--------------------------+
  |    | DAOFactory   |     |             |  | The DAOFactory uses a    |\
  |    +--------------+     |             |  | doa.properties file in   | \
  |            |   |        |             |  | which is specified which +--+
  V            |   |        V             |  | concrete instance should be |

+- -- -- --+   |   |      +- -- -- --+    |  | returned by the DAOFactory. |
|  DAOXxxx |   |   |      |  DAOYyyy |    |  +-----------------------------+
+- -- -- --+   |   |      +- -- -- --+    |
  ^      ^     |   |                      \
  |      |     |   +--------+              \
               :            |               \ 
  |      +- -- -- -- --+    |                > DAO Layer
               :            |               /
  |            V       |    V              /
+----------------+   +----------------+   |  +----------------------------+

|  JDBCDAOXxxx   |   |  CJDODAOXxxx   |   |  | The DAO implementaions use |\

+----------------+   +----------------+   |  | ValueBeans (Xxxx) that are |
\ 
|+ insert(Xxx)   |   |+ insert(Xxx)   |   |  | returned to theBL
instance.+--+
|+ update(Xxx)   |   |+ update(Xxx)   |   |  | Or gotten from the BL layer,
|
|+ delete(id)    |   |+ delete(id)    |   |  | and 'stored' in the DB (for
|
|+ getAll()      |   |+ getAll()      |   |  | example).
| 
|+ searchById(id)|   |+ searchById(id)|   |
+-------------------------------+
+----------------+   +----------------+   |  
               }       }                  /  
               |       |                    
               |       |
               |       |                
               V       V                  
             +----------+                 \                   
             |   Xxxx   |                  > Value beans layer
             +----------+                 /                     
                                            


+-- -- -- --+
| interface |
+-- -- -- --+

+-------+
| class |
+-------+

<--  --  These 'arrows' represent implements interface.

<------  These 'arrows' represent uses.


Good luck, Tjeerd


> -----Original Message-----
> From: Ender KILI�OGLU [mailto:[EMAIL PROTECTED]]
> Sent: vrijdag 12 april 2002 15:40
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] whats the proper way of using Castor JDO in
> servlets?
> 
> 
> We use with static initilized class. Every db request 
> maintained by this
> class. You can call it as a wrapper or utiliy class. 
> Impressed from one
> castor sample related to jboss If I remember correctly
> 
> Ender
> 
> 
> -----Original Message-----
> From: Francisco Hernandez [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, April 10, 2002 1:08 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] whats the proper way of using Castor JDO in
> servlets?
> 
> 
> what is the proper way of using Castor JDO in servlets?
> 
> right now im basically doing all the mapping file and database file
> loading in every different servlet
> 
> should i put my Database object into the application scope? or what
> other strategy do you guys use?
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 

This e-mail and any attachment is for authorised use by the intended recipient(s) 
only.  It may contain proprietary material, confidential information and/or be subject 
to legal privilege.  It should not be copied, disclosed to, retained or used by, any 
other party.  If you are not an intended recipient then please promptly delete this 
e-mail and any attachment and all copies and inform the sender.  Thank you.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to