What I'm trying to grasp is where it it best for the business object <--->
dao interaction to take place.  OK, let's make an example, cause I'm having
trouble thinking abstractly tonight...

An online store customer selects several products, clicks "check out", which
calls a CheckOutAction.  From there:

1.  The CheckOutAction retrieves a Customer and a List of Product's from the
session; it creates an Order out of those components; it then calls
placeOrder(Order) on a Store business class.

2.  Store.placeOrder(Order) saves the Order to persistent storage; then uses
an Emailer business class to emailOrderConfirmation(Order).

----------now the question:

1.  Which component is responsible for discovering the DaoManager,
retrieving the OrderDao from that manager, and telling the dao to save()?
Is it:
    a. the Store.placeOrder() method?
        -or-
    b. the Order business object itself?

Is it the business entity object's responsibility to discover and use its
dao's, or that object's *user's* responsibility?

Matt, you seem to forgo business entity classes and create DAO's right in
your action, passing those to business "use case" classes...

Mahesh, your business "use case" components seem to be the ones responsible
for discovering the right DaoManager implementation, and retrieving the
needed DAO classes...

Anyone make the business entity classes themselves responsible for finding
and using their respective dao's (say, when an Order is issued a save()
command)?

Thanks for all your input!

-Sasha


On 10/10/03 20:25, "Sgarlata Matt" <[EMAIL PROTECTED]> wrote:

> I have a 4 tier architecture.
> 
> PRESENTATION TIER
> - Struts
> - Action classes
> 
> BUSINESS TIER
> - Business Objects
> 
> INTEGRATION & PERSISTENCE TIER
> - DAO Manager
> - DAOs
> - Other database access mechanisms (I do some JDBC using a fancy home-grown
> SQL building mechanism when dealing with particularly complex queries)
> 
> RESOURCE TIER
> - Databases


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to