Questions tagged [domain-object]

Domain Objects are objects made for dealing with the domain logic at the Model layer. These objects generally simulate real (or virtual) items from real-life: Person, Post, Document, etc.

98 questions
0
votes
1 answer

Best way to design Domain with constant in grails

I have lots of domain classes in my project. Many of them has type column. For example: User table has userType column, Book table has bookType column. I often pass these types into GSP g:select source by calling BookType.list() method. But problem…
Emdadul Sawon
  • 5,730
  • 3
  • 45
  • 48
0
votes
1 answer

Spring Boot MongoDB with shared Domain Object

I have 3 services(3 different projects eg ClientService, AggregationService, DataService) that share same domain object and only one of them(DataService) connects to MongoDB and sends back the data to other 2 services. All these services are spring…
Hamid
  • 717
  • 7
  • 15
0
votes
1 answer

Am I using Domain Object correctly?

According to this article here You can think of them [Services] as "higher level Domain Objects", but instead of business logic, Services are responsible for interaction between Domain Objects and Mappers. These structures end up creating a…
0
votes
2 answers

Grails domain Named query for a list

I have a simple Grails application. I have a couple of domains such as following. The scenario is Person has many Telephone (But person class does not have a list of telephone as a variable : Lazy Single-Ended Associations). class Person implements…
Visahan
  • 1,130
  • 2
  • 14
  • 35
0
votes
1 answer

Converting a relationship table into domain objects, Static or Instance method?

Suppose we have 2 tables 'Departments' & 'Users'. There is also another table called 'UserDeps' for user<->department relation. For the first 2 tables we have 2 classes for domain objects. There is a layer in the app. for converting tables into…
BHP
  • 443
  • 4
  • 13
0
votes
1 answer

Multiple domain objects creation in Grails

I would like to create around 30 domain objects inside a controller. Here is how I wrote for the first object and it works fine (can see the output on index.gsp). Now, if I have to do the same for the 30 objects I need, should I have 30 different…
NanoNi
  • 315
  • 4
  • 16
0
votes
1 answer

Where should reside the logic to assemble the domain object from DAO?

I've read almost every questions here and a lot of related argument in the www, but still I'm not sure to well understand the point, and probably I miss something that is obvious to everybody else, since I think is quite a common…
Marcoc1712
  • 321
  • 2
  • 10
0
votes
1 answer

Grails - Domain object doesn't validate correctly

I'm trying to set the date of birth of a person using jQuery Datepicker. However, all I get is that the Property dateOfBirth must be a valid Date. So, originally, my controller looks like this: def update(Person personInstance) { if…
gabriel
  • 347
  • 3
  • 18
0
votes
3 answers

Does anything speak against making all domain objects inherit from INotifyPropertyChanged?

I'm refactoring and redesigning the domain objects of my application which uses MVVM to some extent. Is there anything that speaks against making all Domain objects (POCOs) inherit from INotifyPropertyChanged, so anyone can observe the objects as…
Alexander Pacha
  • 9,187
  • 3
  • 68
  • 108
0
votes
2 answers

How to implement a read only controller action

I have an Order domain class (hasMany = [items: Item]) and an edit screen which lets you edit an instance of Order. The edit screen has the totalCost field which is calculated via ajax as items are added/removed. The backend calculation of totalCost…
zoran119
  • 10,657
  • 12
  • 46
  • 88
0
votes
1 answer

Mongodb persist domain entity and protect invariants

I am using domain driven design with an aggregate root and child entities. The aggregate invariants are enforced via the aggregate root ConfigurableService methods, chaining through to methods of the child entities, with a list of Groups and…
morleyc
  • 2,169
  • 10
  • 48
  • 108
0
votes
1 answer

Cleaning up my Application Structure... Domain Objects and Data Mappers

I've been developing an application utilizing ZendFramework 1.1 for the better part of two years now, and as-so it has seen a few different stages of refactoring from me learning or trying something new. At its current state, I feel that my…
John Hall
  • 1,346
  • 13
  • 27
0
votes
2 answers

Domain Object: setters and getters or just public properties?

Should I validate the domain object properties when they are being set? In this example I've got a User domain object from my model layer and currently am just validating the type and/or format of the passed in parameter before setting the property,…
Kid Diamond
  • 2,232
  • 8
  • 37
  • 79
0
votes
1 answer

Mapping Domain Objects to persistent objects

This is not a question with a clear answer, but I need some advice for my architecture. There might be a lot of different opinions about this topic. I am trying to move my architecture from stupid entities to rich domain objects. In my current…
SebastianStehle
  • 2,409
  • 1
  • 22
  • 32
0
votes
3 answers

Value objects in DDD

I have Order and OrderType classes in my sale module, that OrderType class uses for some categorization goals and applying some business rules on Orders. each class has its own table. I want to apply DDD techniques on my project. So, I think that…
Masoud
  • 8,020
  • 12
  • 62
  • 123