• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

SCEA - Domain Modelling  RSS feed

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello SCEAs and SCEAs to-be!
concerning the domain and class model I would like to hear your
opinion.
1. I think if two classes have a 1-1 relationship you can make a
single class out of them by combining their attributes (e.g. Customer
and Address -> you can put the attribute "street" or "city" in the
Customer class). Do you think this is ok?
2. I think classes can only be singular?! Is it possible to name a class e.g. "Articles"???
3. Assume you have only 4 classes in your model: Customer,
Order, OrderPosition and Article. The relationships are as follows: Customer-Order (1,0..*), Order-OrderPosition (1,1..*), OrderPosition-Article (1,1..*).
I wonder in which scenario a (1,1..*)for the OrderPosition-Article-Relationship would be applicable?
What do you think?
Roger
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roger,
Here is what I feel for the points you mentioned
1. Always think in terms of real life objects. Assign only those responsibilites, which are relevant to that particular class. Its always said that when one is not clear with adding an attribute to a class or create a new seperate class. Always go with having a new class.
2. You can offcourse have a clas to hold a collection of similar class. but I am not very clear on this. May be some one might put some clear guideline.
3. This depends on the scenario you are talking about. OrderPosition is meant to hold a specific Article detail, but it can also hold details for collection of Article object.
Thanks.
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roger,
i would like to add -
1. Having 1:1 relationship between classes doesn't imply u should merge them. Keep them separate as they can be altered later,aggregated by some other class or simply associated with some other class too.
2. Acceptable convention is to have singular name entities as classes. However, there r authors who have used plurals. So it depends.
3. I think, in all likelihood u will have scenarios like 1 orderposition has at least 1 article contained in it; otherwise the order itself in a broader sense would become void.
Correct me if i didn't get u.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!