posted 12 years ago
HI,
I have a sample code below.In which i fetch collection of half filled PrefixBeans from database.Then i use a service class to derive the remaining properties of the prefixbean and update the bean.My doubt is since the remaining bean properties are dervied from one or tow bean properties.Should i write the derivation logic in the bean getters or is it ok to calculate the remaining properties in the service class.?If i do in the service class, is it violating any OOP principle?Do you find any code smell here?
The PefixBean will contain the organizationPrefix and existingItemCount already filled by the DAO.
The below service method is used to calculate the remaing fields of the PrefixBean.