"samdoyle" wrote : By doing this it makes it easier to do things like embed logic into entity beans which is not their intended use. A colleague of mine who is brand new to EJB3 and Seam did that just the other day and I was like wow, that is pretty odd. |
I would have to strongishly disagree (although I know this is a religious issue). I think logic *should* be in the entity beans. Most definitions of object-oriented design goes something like "Each class encapsulates some data and all operations upon that data". Personally I try to avoid using entity beans as dumb DTO:s. It seems so pre-EJB3:ish. "Why do we need a DTO?" "Hmm. Because we always have had them. Now be quiet and code" :-) Yes. If an entity needs data, I pass in a repository so that it can use it itself (or even have the method lookup the repository itself) instead of having someone else do it and pass in the data. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097239#4097239 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097239 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user