Hi, In typical DDD application Services call entities methods to change some business state (for example, productService calls Product.changeName() to change...
If you wish to reuse your domain model across different application boundaries , it is usually not advisable to leave the decision of persistence to your...
... Here's how we do it in Qi4j(.org): All work on Entities is done through a UnitOfWork. When a client begins a process it creates a UnitOfWork, which it then...
Given just the two options, I would definitely go for no. (1) as I think entities should ideally know nothing about persistence. However, if you use an ORM...
Thanks for your replies, i'm still not sure why entities should be unaware of the need to save/commit themself after some change. From the rational point, it...
Would this work if we made manual updates to the database either with SQL or through stored procedures? In practice we can not totally avoid them for a variety...
When entities are changed, most of the time a lot of external things should change as well (like the database or the GUI). Therefore I always use events to say...
IMHO, its just down to separation of concerns and the Single Responsibility Principle: A Product entity represents a specific business concept in the domain....
Do you mean if the data for your entities is being changed externally by other applications/users at the same time as your application is running? Hibernate...
David, When your DB change - nothing changes in the Domain. It's the IDao implementaion (located in different package/project) which changes. Al, 1. About...
Actually I mean changing them internally within my application by writing hand made SQLs or stored procedures. I can see refreshing entities in the session and...
What you are talking about is the Active Record pattern. It is a perfectly viable solution, but begins to break down as your domain becomes more complex. You...
1(a) Again, to me, resources such as images and custom files seem more like a detail of the Application itself rather than the business domain. So I'd be...
7195
Cristian Libardo
cristian.libardo@...
Apr 2, 2008 9:48 pm
I think the spirit of ddd is to think wether it makes sense for your object to know about things like persistence? Dog d = new Dog(); d.Bark(); // probably ...
No, does Not Make Sense! That is exactly what we have repositories for. Timmo Am 02.04.2008 um 13:10 schrieb Cristian Libardo <cristian.libardo@...>: I...
On Wed, Apr 2, 2008 at 4:10 AM, Cristian Libardo ... I think it's fine to put a save method on the dog, as long as it doesn't actually know the details of how...
7198
Cristian Libardo
cristian.libardo@...
Apr 3, 2008 7:10 pm
I guess there's no right answer here. Personally I prefer not referencing services such as repositories directly from entities simply for technical reasons....
I've run into a snag while trying to implement this: an entity in my domain is also a security element. The security domain model appears valid, as does the...
I've faced the same problem, when developing an application in Grails, using the acegi plugin. Since it treats Role and User as domain concepts (and generates...
... This is precisely the sort of problems that Qi4j(.org) is dealing with by introducing support for mixins in Java. In my previous job work with the...
Hi Rickard and Yevgeny, That is a good explanation of Qi4j project. I had heard about it before, but its good to get the reminder. I am also working on a...
Before going to AOP or to a specific framework (Qi4J) I might recommend doing "mixins" the manual way since you are discussing using them in relatively few...
I had a somewhat similar issue on a project I worked on, and I can tell you my solution, though I accept that some people might not like it. The business...
This particular problem can also be solved by applying Role and Player <http://c2.com/cgi/wiki?RoleAndPlayer> within your application and domain model, as...
Hi David, Sorry for the delayed reply here. Yes I have used Repositories (and I mean classes) directly from within domain object method code; here's a...
I am working on a project that has a domain model and consistently uses repositories for most of the data access but I have run into a feature where a...
IMO all DAO things (interface and impls) belongs to data source layer. I put them in a separate package and assemble it as a separate jar file if you are ...
As I mentioned, the data access is not repository related. For example, one of the stored procedures returns a Boolean value as to whether or not an account...
I've read, I think in PoEA, that domain facade services shouldn't call other domain facade services. Given that they're simply for coordinating domain logic,...
Hi all, I skimmed through chapter 5 of Eric's book to decide about recommended packaging scheme by DDD. From section about modules I think the following would...