Lately in my domain model I have come across the question of where to place logic that deals with collections of entities. It seems I have several choices. ...
IMHO, collections are building blocks, generic building blocks; domain logic doesn't ever belong in them. If you have logic that deals with groups of...
I think Fowler was saying that he doesn't encourage strongly typed collections, but rather encapsulating them, which I agree with. Just to make sure we're all...
Hi Ramon, I would like to give a specific example. In my domain I have the need for tracking changes to a boolean flag. Instead of a simple boolean I have a...
I think there could be value. But I'd dig a little deeper and try to come up with some concept that they are reflecting. The Fee collection with a total -- is...
I don't have much to add to what has already been said. Only thing is that a Typed Collection of Entities with behavior looks like a Manager. I have always...
Eric's right, you need to dig deeper into the problem, the thing you're trying to model deserves a better name than AuditEventCollection. You probably already...
Ramon, Eric and others: Thanks for the reponses. I think the conversation so far and the switch to talking about specifics in my domain have helped me uncover...
I'm just trying to get my head around some of this. I'm using NHibernate in an ASP.NET application. Does this count as a type of repository? I have a facade...
... You may find this post from Udi helpful: http://groups.yahoo.com/group/domaindrivendesign/message/1874 Cheers Shane __________________________________ Do...
If I hand the Repository a query to fulfill on my behalf and that query is bound to some database tool (say Hibernate), isn't my Repository (and the rest of my...
... I would pass the Repository a data access object that knows how to handle the query. So my CustomerRepository depends on a CustomerDAO. The actual DAO it...
It's pretty easy to build a generic query layer. Queries are after all, just predicate expressions, in every language. No language owns and/or/not and "> <...
... I don't think so. Considered in isolation, I think it's a non-trivial task. To make it worse somewhere I need to translate my generic query layer to my...
Queries are just trees of composed predicates, whether it's SQL, or XPath, or looping over an array in memory, they're all doing the same thing with just...
While reading through DDD book again last night I wondered how to implement Application Services and Domain Services (as explained on chapter 5) in APS.NET...
Hello, I quite often run to the problem, where I have to manage several different type aggregate collections for a single domain entity. Suppose I have an...
I agree with John's points, but let me express it a little differently. When I'm trying to decide whether to expose something or not, and this means a...
I'm not quite sure if I've got my head around the idea that a Repository should express collection semantics. I get that a repository should be treated by its...
... How does it seem to you that it should work? Suppose the Repository couldn't do those things; how would they then be coded? Suppose it only dealt with...
... Without an indexer, I would just have methods like Save(), Update(), Delete(), etc (maybe a SaveOrUpdate() a la Hibernate). Ultimately, if I put an...
Brilliantly put Eric and John. I understand your points and after inspecting the current domain I think it conforms to your ideas. The issue I found smelly was...
... Yes ... but then where and how would the indexing capability be implemented? Don't we need it somewhere? ... It might be. I'm trying to figure out the...
... I'm programming a Repository for a User Entity. I'm using C#/.NET. The Repository uses a "strongly-typed" DataSet generated by Visual Studio as a cache....
... I'm with you on this. I guess my only hope is to find the time to build something, perhaps several different ways. At this moment, that feels painful to...
Just an API/aesthetics observation, but one argument against using an indexer to access datastore bound entities could be that it doesn't clearly communicate...
There are some interesting capabilities coming in .NET 2.0 with the addition of generics and anonymous delegates that make for some Specification-ish stuff. ...