Questions tagged [domain-objects]

30 questions
118
votes
6 answers

What is a domain?

I see this term a lot in the context of software architecture ("domain-model", "domain-driven-design" etc.). I have googled it, but I get tons of different definitions. So what is it really?
16
votes
7 answers

Primitive vs Class to represent simple domain object?

What are general guidelines or rules of thumb for when to use a domain-speciifc object vs a plain String or number? Examples: Age class vs Integer? FirstName class vs String? UniqueID vs String PhoneNumber class vs String vs Long? DomainName class…
10
votes
2 answers

JavaFX - the right way to use Properties with domain objects

JavaFX has provided a bunch of new Property objects, such as javafx.beans.property.DoubleProperty which allow you to define fields which can be automatically observed and synchronised. In many JFX examples, the MVC model class has a number of these…
pjm56
  • 101
  • 4
8
votes
2 answers

Separating Domain Object and Data Models

I looked through a lot of articles, blogs, and SO topics about separating domain object and data models. Almost every answer said: You should have separate classes for the domain and data persistence, because... I understand why it is good, but I…
5
votes
1 answer

Where does business logic go that involves multiple aggregates?

I'm still a beginner when it comes to domain driven design, and I am trying to model something like an RPG's battle system as a bounded context. I am trying to model a bounded context in which a Combatant has a list of abilities, and each Ability…
4
votes
3 answers

Should the DTO be able to parse itself from and to Domain?

Let's say there's the class Book, with different models in different endpoints: Endpoint A (consumer): class Book{ Map chapterName_content } Endpoint B (provider): class Book{ string [] chapterNames string [] content } Let's…
4
votes
1 answer

Domain Model vs Service in a MVC context

At the end of this article from Martin Fowler there is this sentence: In general, the more behavior you find in the services, the more likely you are to be robbing yourself of the benefits of a domain model. If all your logic is in services, you've…
4
votes
2 answers

DDD: must all Aggregates model relationships, or they can be "shallow"?

Sometimes my Aggregate will be very simple; some scenarios are simply not complex enough to require deep trees of objects and relations. Consider a Website Monitoring application, which periodically pings a URL to check if it is alive. The Web App…
Levidad
  • 798
  • 1
  • 7
  • 10
4
votes
1 answer

In MVP, should the View have access to Domain objects?

Let's say I have a form for representing a user. When pressing the "Save" button, should a User object be: constructed by the View based on the input, then passed to the Model via the Presenter and then inserted into the database by the…
Michael Haddad
  • 2,651
  • 3
  • 17
  • 27
4
votes
1 answer

Making a change-prone class immutable

According to Effective Java's Item 15: Minimize Mutability, it is always better to make classes Immutable. According to that, how would I handle classes that are by nature given to change? Some examples would be: A Customer class, where an…
IntelliData
  • 981
  • 1
  • 8
  • 15
4
votes
2 answers

is it bad practice that controller call domain objects(entities) direclty instead of service?

is it bad practice that controller call the methods of domain objects directly instead of service? to explain more: I figure out that in good design controllers call service and service use Domain objects(entities). but sometimes in controller I…
3
votes
2 answers

Should I save my entire domain object or update individual properties?

Scenario: An application is going to perform operations on an entity. That means retrieving it from storage, possibly making modifications, and then persisting those changes back to storage. I'm hearing conflicting approaches. We should retrieve an…
Scott Hannen
  • 989
  • 1
  • 6
  • 13
3
votes
1 answer

What domain objects might I need to represent a user and users profile in a forum web application

I’ve been trying to get a firm understanding of the MVC design pattern so that I can write my own framework for implementing the back-end of a forum web application using Slim 3. In particular, after reading this, and asking this and this question…
SneakyShrike
  • 141
  • 5
3
votes
2 answers

Where to put domain classes in a component structure and diagram?

I've got a microservice called ExamResults, with a very simple component structure: ExamResults (offers: IExamResults) (requires: IExamResultsDAO) ExamResultsDAO (offers: IExamResultsDAO) This service gets passed exam results (student ids,…
KeizerHarm
  • 121
  • 1
  • 14
2
votes
0 answers

Clean Architecture, what are objects that does not completely fit as entities?

I'm reading chapter 20, "Business Rules", of clean architecture book, in this chapter Uncle Bob defines entities as: An Entity is an object within our computer system that embodies a small set of critical business rules operating on Critical…
Thiago Dias
  • 383
  • 3
  • 11
1
2