In addition of Kent Beck book, I'll add this one, mandatory to start with, and then go to Beck's pattern: Smalltalk, Objects, and Design by Chamond Liu This is...
Recently we undertook a bit of a shift in a project I'm working on and I'm just processing the change but wanted to see what others thought. The original model...
Most of the time DTOs are used for complex data structures, lets say a data set with (Project, Task, WorkItems) however for simple entities (single table)...
How do the DTOs, or now the domain objects, get sent to the UI? Is there a network in between? In other words is this a remote think client? If not, then I...
there may also be situations to use gui helpers. Sometimes your gui can be complex enough that it needs data in a different format than your domain objects...
Re gui helpers or adapters - absolutely. These can be very useful. But I'd introduce them on an as needed basis. If the domain object does what the gui...
I agree with your suggestion and it would make the domain more clear. Since Item is heavily influenced by Account, should I not have a factory class but rather...
yeah, we use them as a last resort - I'll sneak extra methods into the domain objects first, then resort to a helper if things get more complicated. Rex...
I'm against helpers in general, often it means not-so-good interface exposed by the service. In addition, it opens a back door for no-one-wants-to-have stuff....
... I have been planning to distribute domain objects also with remote services. This is how I planned to do it: I think i could make all domain objects...
In my experience, once you decide to have a single remote service for many clients, the first thing you need to be considering is how you are going to handle...
You might be violating the single responsibility principle, which says that each class should handle exactly one responsibility. You will have domain objects...
One thing to keep in mind is that domain objects are fine-grained and stateful, and remote api's are coarse-grained in general. Distributed Object has many...
... Yes, this is a thing that has to be remembered. I think DTOs were originally invented to avoid the need to call fine-grained methods of entity EJBs. In my...
... When you say 'middle tier' and 'ui tier', are these just logical layers running within the same process? In Java terms, are the middle and ui layers both...
Good to see it's not distributed object. My ignorance. I don't know much about Service Data Objects, but one thing to consider is versioning, one of the tough...
... They are running in different processes. The domain layer is in an EJB container running in machine 1 and UI layer is running in a Servlet container...
DTOs are also useful for isolating service requestors from service implementations. The domain the services use for their implementations can evolve without...
Jim, I've heard that argument, and worked on systems that used DTOs precisely for that reason. But in my experience it's not a good approach. It adds more...
OK, then you will need DTOs, since you're running in a distributed environment. If you have a rich domain model, then definitely do NOT try to make your...
Steve, Interfaces by themselves aren't enough because of the types of their parameters. The clients are coupled to implementations through these types. DTOs...
Are you worried about having to add and remove parameters? While it might be a pain to have to change client code when adding a parameter, it would be an even...
No, not adding or removing parameters, but having their types change. I think DTOs are intention revealing - but in this case the intention is what data is...
I have an AggregateRoot called Organization it has a child which is RelatedCompany which has a child StaffMember In my web app, I am trying to get the...
Not to beat a dead horse too much (we may never settle this one!), but here's an interesting article on using DTOs in a non-distributed environment: ...
Local DTOs can also be useful for carrying a client's edits into a transaction context in an undistributed system, when there is no better way to do so. Randy ...
No, your Organization repository should only return Organizations or answer questions about the organizations. Is StaffMember part of the aggregate? Or can you...