3
votes
3answers
197 views

OOP what is meant by object-to-object communication

I've been reading in basic concepts of OOP,as i'm trying to make this shift from transactional scripts to more oop manner in php, and i often come across this definition : An object stores its ...
2
votes
4answers
181 views

Basic OOP Question for a Report

I'm in development of a sample project in Android for a friend's phone that keeps track of his sales. At first, one of the requirements was to create yearly reports of this sales data. This would be ...
0
votes
2answers
217 views

How do I make a domain model that doesn't violate OOP?

My game reads a number of JSON files, deserializes them, and hands the resulting objects off to the classes that need them. These deserialized objects, which can be thought of as the domain model, are ...
0
votes
1answer
102 views

Why aren't Entities allowed to reference other entities inside an aggregate except the root?

I have read in several places this following rule concerning Aggregates: Entities in one aggregate can hold references to any other Aggregate Root, but never to an Entity or Value Object inside ...
4
votes
1answer
164 views

OOP, domain models, and the user

When developing domain models, I can see two major ways of thinking about the user: The first one assumes that a program is a kind of "simulation" of what happens in the real world, and the user is ...
4
votes
5answers
495 views

How to model an address type in DDD?

I have an User entity that has a Set of Address where Address is a value object: class User{ ... private Set<Address> addresses; ... public setAddresses(Set<Address> ...
23
votes
3answers
3k views

Rich Domain Models — how, exactly, does behavior fit in?

In the debate of Rich vs. Anemic domain models, the internet is full of philosophical advice but short on authoritative examples. The objective of this question is to find definitive guidelines and ...
1
vote
2answers
150 views

Determining the aggregates in this domain

I'm working on an ordering system where we receive tab delimited files that look like this (I removed most of the columns for clarity): OrderId OrderLineId BuyerName BuyerAdress ...
1
vote
1answer
597 views

Should we mock entities and value objects when doing DDD?

After reading a few articles about Newable vs Injectable objects and how these concepts relate to DDD's services, entities and value objects, I was left with some doubts about using newables in my ...
0
votes
0answers
61 views

Subtyping and Enumerable invariant

I have read the following from http://stackoverflow.com/questions/56860/what-is-the-liskov-substitution-principle Subtyping is appropriate where the invariants can be enumerated. Where ...
7
votes
2answers
497 views

Domain Services as facades

I read .NET Domain-Driven Design with C#: Problem - Design - Solution and I noticed that the author created a domain service for each aggregate root. However, the domain services were only facades to ...
2
votes
2answers
2k views

Identifying Domain Services & Application Services when doing DDD

-I'm trying to figure out how to identify Application Services in my application. I think I can identify a Domain service by 2 things: It acts as a facade to the repository. It holds business logic ...
2
votes
1answer
260 views

Domain Driven Design with an EAV database model

How can one apply DDD to a EAV database model? Consider this EAV database model: How am I supposed to build a domain model if all my entities and their attributes will be stored in the database? ...
0
votes
3answers
132 views

Should a service use session information?

As an example, if I have a Post service and have a method to retrieve all posts for the logged in user, is it OK to have a findPosts() method that uses an injected Security service to get the user ID ...
4
votes
2answers
276 views

DDD and filtering

I am developing an app in ddd maner. So I have a complex domain model. Suppose I have a Fare object and Airline. Each Airline should contain several or much more Fares. My UI should represent Model ...
3
votes
4answers
1k views

DDD: Service or Repository

I am developing an app in DDD manner. And I have a little problem with it. I have a Fare (airline fare) and FareRepository objects. And at some point I should load additional fare information (from a ...
5
votes
1answer
232 views

DDD: service contains two repository

Does it correct way to have two repository inside one service and will it be an application or domain service? Suppose I have a Passenger object that should contains Passport (government id) object. ...
3
votes
1answer
529 views

Domain Models (PHP)

I have been programming in PHP for several years and have, in the past, adopted methods of my own to handle data within my applications. I have built my own MVC, in the past, and have a reasonable ...
7
votes
10answers
718 views

Should an image be able to resize itself in OOP?

I'm writing an app that will have an Image entity, and I'm already having trouble deciding whose responsibility each task should be. First I have the Image class. It has a path, width, and other ...
1
vote
2answers
348 views

Are factors such as Intellisense support and strong typing enough to justify the use of an 'Anaemic Domain Model'?

It's easy to accept that objects should be used in all layers except a layer nominated as a data layer. However, it's just as easy to end-up with an 'anaemic domain model' that is just an object ...
3
votes
7answers
843 views

Inheritance using non-abstract base class

This post is based on the question http://stackoverflow.com/questions/49002/prefer-composition-over-inheritance/11758048#comment15634305_11758048. Some people said - check whether there is “is-a” ...
3
votes
4answers
239 views

How to decide whether to implement an operation as Entity operation vs Service operation in Domain Driven Design?

I am reading Evans's Domain Driven Design. The book says that there are entity and there are services. If I were to implement an operation, how to decide whether I should add it as a method on an ...
11
votes
4answers
518 views

Avoiding bloated Domain Objects

We're trying to move data from our bloated Service layer into our Domain layer using a DDD approach. We currently have a lot of business logic in our services, which is spread out all over the place ...
6
votes
3answers
868 views

Duplication in parallel inheritance hierarchies

Using an OO language with static typing (like Java), what are good ways to represent the following model invariant without large amounts of duplication. I have two (actually multiple) flavours of the ...
7
votes
4answers
664 views

Refactoring in domain driven design [closed]

I've just started working on a project and we're using domain-driven design (as defined by Eric Evans in Domain-Driven Design: Tackling Complexity in the Heart of Software. I believe that our project ...