Again it comes down to how you choose to implement your system: for
something like that, it could also be calculated at another level and placed
on a value object if access to that calculated attribute was needed outside
of the business tier.  I personally choose NOT to perform any extra logic my
entity layer.   

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, December 06, 2004 7:46 AM
To: [EMAIL PROTECTED]
Subject: RE: [Andromda-user] Adding business methods to Spring Entities

Hi Chad,

just imagine a simple class that has several attributes that can be set and
some other attributes that can be calculated from the other attributes. The
java.util.Date class is a well-known sample for this typ of classes.

You might argue that this is not very "business method"-like, but it is
needed nevertheless.

- Peter

>-----Original Message-----
>From: Chad Brandon [mailto:[EMAIL PROTECTED]
>Sent: Monday, December 06, 2004 3:37 PM
>To: FRIESE, PETER; [EMAIL PROTECTED]
>Subject: RE: [Andromda-user] Adding business methods to Spring Entities
>
>
>However what advantages does it provide? It may correspond to 
>the "Hibernate
>philosophy" however I've always preferred to make my entities 
>be data access
>only and the services provide the business methods, sometimes 
>it make sense
>to add a method to the DAO if it may be called from multiple 
>places from the
>service (so I added that option) but I still wouldn't consider 
>it a business
>operation since clients should only be calling the service 
>layer anyway. 
> 
>Peter, you say placing operations on DAOs mixes concerns, 
>however I'd say
>placing "business" operations on hibernate entities correspond 
>just as much
>or more mixing of concerns (since they provide the actual 
>mapping to the
>underlying database).  I guess what it really comes down to is 
>how to, is
>how you prefer to design your system.
>
>Chad
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of
>[EMAIL PROTECTED]
>Sent: Monday, December 06, 2004 2:01 AM
>To: [EMAIL PROTECTED]
>Subject: RE: [Andromda-user] Adding business methods to Spring Entities
>
>Hi Chad, hi Roy,
>
>>> Chad Brandon wrote:
>>> Business methods are currently created on the DAOs if you model
>operations
>>> on the entities, does that not work for you?
>>
>> Roy wrote:
>>The short answer is no.  I don't think an object that wants to call an
>>entity's business method should depend on its corresponding DAO.
>
>I second that. According to the Hibernate philosophy, the 
>business objects
>should contain the business methods, thus producing a rich 
>domain model.
>
>Adding business models to DAOs results in a mix up of two 
>concerns (data
>access on one hand, business logic on the other hand).
>
>- Peter
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from 
>real users.
>Discover which products truly live up to the hype. Start reading now. 
>http://productguide.itmanagersjournal.com/
>_______________________________________________
>Andromda-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/andromda-user
>
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to