struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <>
Subject Re: Confusing model with controller
Date Tue, 25 May 2010 12:08:49 GMT
2010/5/25 Robert Graf-Waczenski <>:
> My intuition for the "model" is "that which is serialized to disk" (or, more
> generally: "to persistent storage"). This means that such a class does not
> contain any business logic but only has getters and/or setters.

No, domain objects do not need to be anemic:
You can put logic in your domain objects.

> In reality
> (and in many nontrivial projects) the distinction is not as strict, so your
> "model" class may very well have methods that go beyond getting/setting
> properties and you may in fact have instances of "model" classes that live
> (at least temporarily) outside the "model" domain.

"business logic" methods are, in fact, part of the model.
Let the services, or DAO, or whatever, do only the
persistence/retrieval part of your code.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message