This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I was wondering about something. We are used to say to do business logic in session beans and leave the persistence layer only to actually persist data. Nevertheless, strictly following this "rule" we would ONLY have setter and getters methods in entities ejbs (beyond the life-cicle and finder methods). Am i correct til this point? If remember the following Entity EJB method on the on-line j2ee tutorial at tusc.com.au.
Then, if i wanted to be strict, i'd say this method shouldn't be on a Entity Bean (?). Could anyone give their opinions? Thanks.
Common methods I have on Entity Beans are things like increment or decrement methods. For an example, for an Account Entity Beans I can have a single withdraw or deposit method that adds the balance to the account, rather than having a Session Bean extract the current balance, do the math and then set the new balance.
Roland Barcia: IBM Distinguished Engineer, CTO Mobile for Lab Services