Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Currently the project on which I am working is being developed with Spring, Hibernate and Struts.

The business layer consists of simple java beans with no behavior in them only properties and getter and setter methods, the services are written on them which operates on them and call DAO layer methods and all.

My questions is that is it object oriented way of designing or simply the procedure way in which the data and the functions on which they operate are not together?

Please provide your thoughts and inputs on how the business logic is design and implemented in j2ee application, is the domain model contains business methods or are they simply dumb objects which have only data and services written on to them?

share|improve this question

closed as not a real question by Walter, Matthieu, Mark Trapp, gnat, Ryathal Sep 14 '12 at 19:45

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

First of all: J2EE is an outdated name, it's been officially "Java EE" since Java 5 (i.e. for over 5 years). And a project based on Spring is typically not considered a Java EE project.

As for your question: you're describing an anemic domain model, which is indeed considered an antipattern and not proper OO nowadays (it used to be an acceptable workaround to technical restrictions of older J2EE specifications).

A proper OO domain model should definitely contain some business logic, but only that which expresses fundamental facts and restrictions of the model. There should definitely be a separate service layer which operates on the domain mode and implements use case specific logic.

share|improve this answer
okies, that's why J2ME is also known as Java ME. – Lucifer Sep 1 '12 at 15:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.