Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generalizing domain objects

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we not generalize from the car parts (e.g have a base class named Part and have entities such as suspension, brake pads, etc, extend this base class)? I read in another post that candidates have failed because of such a change.
The requirements state that more parts will be added in future, so having the base class makes sense. Cade's design does this with the User types - he's got a generalized User class.

Any ideas?
 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think generalizing should be issue as you are following OO principles to move common attributes to base class. Moreover this does not change domain model as the parts (suspension, etc) still exist as sub class to the base class.
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you Rishi. But I am not sure if I should do it. As mentioned, I believe people have failed because of this.
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Can anyone who has done this please clarify?

I'd really like to generalize from the car parts (for Dreamcar assignment), but I don't want to risk failing because of a silly mistake.

Again, I read of people failing because of this. They then re-submitted without generalizing and passed!!

Thanks.
 
Rajan Choudhary
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before I type, I want to make clear that I haven't gotten the exam results yet and submitted recently.

I haven't come across any threads which states that candidates failed because of generalization used in this particular case BUT in reality If I were an examiner, I would have not let the candidate get thru who used generalization in this particular case.

How would the new parts be added, by adding new sub classes? come on.... You would provide a new build for such a small thing or you would restart the app if picking from config for such a small thing.

Generalization did not make much sense to me either even after going thru the threads who strongly believed in Generalization. Guys parts are coming from inventory which is a web service call. If inventory starts returning 4 parts in the response, would you create 4 objects and populate the values? I think, hint is enough in order to guess solution I provided. There are multiple ways and everyone has his own ways but as long as you don't need to change anything in system for extensibility, you are good.
 
Youssef Ben Kaddour El Wazzani
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

Marcelo Ortega wrote:Guys,

Can anyone who has done this please clarify?
I'd really like to generalize from the car parts (for Dreamcar assignment), but I don't want to risk failing because of a silly mistake.
Again, I read of people failing because of this. They then re-submitted without generalizing and passed!!

Thanks.


I'm confused ! Have you read this disscussion, especially this message, unless i didn't understand it, it's the contrary of what you are saying, in the message i give the link to, the guy (by the way, i thank him very much for the precious information he gives us after he fails) seems to say that he fails because he threw away some of the classes replacing them with two generic ones...

In the end, what i understand is that theses parts, CarPart1, CarPart2 and CarPart3 has somehow to be present in the class diagram, and they could'nt interact directly with other classes, which mean you will need a base class.

To note, like Rajan, i'm not certified yet, i submit and am waiting for the results.
 
Kumar Amit
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajan Choudhary wrote:Before I type, I want to make clear that I haven't gotten the exam results yet and submitted recently.

I haven't come across any threads which states that candidates failed because of generalization used in this particular case BUT in reality If I were an examiner, I would have not let the candidate get thru who used generalization in this particular case.

How would the new parts be added, by adding new sub classes? come on.... You would provide a new build for such a small thing or you would restart the app if picking from config for such a small thing.

Generalization did not make much sense to me either even after going thru the threads who strongly believed in Generalization. Guys parts are coming from inventory which is a web service call. If inventory starts returning 4 parts in the response, would you create 4 objects and populate the values? I think, hint is enough in order to guess solution I provided. There are multiple ways and everyone has his own ways but as long as you don't need to change anything in system for extensibility, you are good.

I agree with you Rajan that generalization does not make sense here. The system should work without any code change when more products are supported in future.
Rajan you mentioned that parts are coming from inventory. Does this mean parts are not entities in the SuD?
 
Rajan Choudhary
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Admin, please remove my post if it's beyond the permitted limits....


The data may be coming from X system but physical entity must live in domain model to hold the data for you

I did more than this which made sense to me in order to achieve NFR of the SuD.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic