GeeCON Prague 2014*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Factory Homes Revamp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Factory Homes Revamp" Watch "Factory Homes Revamp" New topic
Author

Factory Homes Revamp

solder Job
Greenhorn

Joined: Jul 30, 2009
Posts: 6
Hi , i am currently working on Factory Homes assignment.

I want to suggest something to have a minor change to the Basic Domain Model which will result in my new class diagram.

Assumption : When the user is using the function "Add Item to House Design" , he is actually working on a SINGLE HOUSE design(current design of the house) which already comes with one fixed roof and one fixed foundation. it means that the user can only add walls, window or door.





The change is: Do away with the class "Aperture". Create a new Class called "Components" to act as a parent class for Walls, Doors and Windows. The House class will be 1 - 1..* association to class of "Components".

I feel that this is more intuitive for design and scalability approach.


May i have your views on this, fellow experts bros?


Thanks

Solder
PMP, ITIL V3, SCEA(I), Comptia Project+, IBM SOA Designer, SCJP , SCJBD
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

The House class will then be the parent class of "Components".



Inheritance represents and 'is-a' relationship. So, a component is-a house? Or a House has components?

-Cameron McKenzie
John Plaer
Greenhorn

Joined: Apr 09, 2009
Posts: 10

Hi solder,

How did you make an assumption that the house already comes with one fixed roof and one fixed foundation, if someone starts a house design from scratch then he might add roof as a component,

and there can be lots of roofs/foundations with varying design/structure.

solder Job
Greenhorn

Joined: Jul 30, 2009
Posts: 6
Cameron Wallace McKenzie wrote:
The House class will then be the parent class of "Components".



Inheritance represents and 'is-a' relationship. So, a component is-a house? Or a House has components?

-Cameron McKenzie


Sorry, the House has a 1 to 1..* association to Components class.

Which means the House can have components.

solder Job
Greenhorn

Joined: Jul 30, 2009
Posts: 6
John Plaer wrote:
Hi solder,

How did you make an assumption that the house already comes with one fixed roof and one fixed foundation, if someone starts a house design from scratch then he might add roof as a component,

and there can be lots of roofs/foundations with varying design/structure.



John Plaer wrote:
Hi solder,

How did you make an assumption that the house already comes with one fixed roof and one fixed foundation, if someone starts a house design from scratch then he might add roof as a component,

and there can be lots of roofs/foundations with varying design/structure.



Hi, one tips i heard from someone is that must reread the requirements set out in the assignment.

For every new function of "add new item to current house design" as written in the requirements, the requirement said add components to the current house design. A current house design will always have ONE ROOF AND ONE FOUNDATION so cannot add more by the user unless the user add another HOUSE which attributes to the final completed design.

So the focus is actually on the current House Design which means the roof and foundation is already there. It only left the walls, doors or windows which can be freely added by the user. In other words, when the requirements talks about adding item to current design, it means adding walls,doors or windows only.

If the user want to have two houses as part of the completed design, its possible, just redo the selection of catalog in first step(to select a house design) followed by going to the second step(add item to current house design) which deals with only adding walls,doors or windows to it.

Welcome any comments and views.

Thank you
vikram kumar
Ranch Hand

Joined: Aug 01, 2005
Posts: 58
Hi, Can I assume that the product class as the one which has a set of pre-existing house styles from which the user can select one to proceed with adding the components.

Thanks,
Kumar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61309
    
  66

"solder solder", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
solder Job
Greenhorn

Joined: Jul 30, 2009
Posts: 6
vikram kumar wrote:Hi, Can I assume that the product class as the one which has a set of pre-existing house styles from which the user can select one to proceed with adding the components.

Thanks,
Kumar


Hi Kumar, YES!

This is what i perceived.


Solder
PMP,ITIL V3, SCEA(I), Comptia Project+, IBM SOA Designer, SCJP, SCJBD
John Plaer
Greenhorn

Joined: Apr 09, 2009
Posts: 10
So the focus is actually on the current House Design which means the roof and foundation is already there. It only left the walls, doors or windows which can be freely added by the user. In other words, when the requirements talks about adding item to current design, it means adding walls,doors or windows only.


Hi Solder,

Are you taking the literal meaning of the word "Current House Design" in order to assume that the roof and foundation is already there?

I can see that a valid house design should have 1 roof and 1 foundation but it does not say that you can not start of by a blank design. and it also does not say anything about the order of components being added. What if someone wants to add the roof at the end by making a choice from a selection of roof types ?

I assume that there is a purpose of a validation check before adding a component to the current design

Jason Marston
Greenhorn

Joined: Aug 03, 2009
Posts: 11
John Plaer wrote:

I can see that a valid house design should have 1 roof and 1 foundation but it does not say that you can not start of by a blank design. and it also does not say anything about the order of components being added. What if someone wants to add the roof at the end by making a choice from a selection of roof types ?

I assume that there is a purpose of a validation check before adding a component to the current design



I am going to talk about uml in general rather than this specific assignment. If we have a class A and a class B. An the accosiation between them is a 1 at the B end.

Then the semantics of the uml multiplicity on the association says A will always have exactly 1 B. If it was allowed at some stage to have an A and not a B, the multiplicity on the association would be 0..1 rather than exactly 1.
John Plaer
Greenhorn

Joined: Apr 09, 2009
Posts: 10

You are absolutely correct Jason, if the multiplicity between object A and B is 1 as well as between object A and C and also between A and D. It does not mean that object B and D should be created first in order to create C.

I hope you get what i mean here. The problem here is more towards the use case rather than the domain model.
solder Job
Greenhorn

Joined: Jul 30, 2009
Posts: 6
John Plaer wrote:
You are absolutely correct Jason, if the multiplicity between object A and B is 1 as well as between object A and C and also between A and D. It does not mean that object B and D should be created first in order to create C.

I hope you get what i mean here. The problem here is more towards the use case rather than the domain model.


Actually Jason and John are both correct. Jason is talking on multiplicity and John is referring to the sequence order.


The million dollar question is whether choosing
Option 1 : you want to treat Roof and Foundation as part of a component for user to select and add into the current house design

OR

Option 2: you want to assume that Roof and Foundation is always there for an initial house design(dont treat Roof and Foundation as component, assume always have availability of it).


I believe John will be choosing Option1.

For option2, as long you state this HARD assumption in your document, i believe you will be PROTECTED.

Am i right? Any experts to comment on this?
Assumptions work wonders when the receiving side accepts it.
Jason Marston
Greenhorn

Joined: Aug 03, 2009
Posts: 11
John Plaer wrote:
You are absolutely correct Jason, if the multiplicity between object A and B is 1 as well as between object A and C and also between A and D. It does not mean that object B and D should be created first in order to create C.

I hope you get what i mean here. The problem here is more towards the use case rather than the domain model.


Lets look at a slightly different example.

If A and B were 0..1 to 1 and the others were the same. You could have a B, C or D without A, but A would always require one of each of the others.

A sounds like we are building a complex object.


In Soldier Job missed a third option in his posting.

Option 3: When a house is created is has the foundation roof and a wall, when you add a roof or foundation, it replaces the current one.

I think the phrase "house style" is the key to answering this and to which assumption anyone will choose to make and document.

Regards,

Jason
Jason Marston
Greenhorn

Joined: Aug 03, 2009
Posts: 11
Another thought.

I think you will both agree that upon completion of the use case all the constraints on the model (multiplity etc) must be valid right?

If we start with a new house and just add a wall. Then at the end of the use case the object graph is in violation of the multiplicity as it must have a roof and foundation.
Jason Marston
Greenhorn

Joined: Aug 03, 2009
Posts: 11
John Plaer wrote:

I assume that there is a purpose of a validation check before adding a component to the current design



I looked over this in great detail. I think the validation check is to ensure it is a valid combination of components. For instance. The domain model says there must be at least one wall. That is ok as far as the object graph goes. If the validation were only talking about the multiplicities it would not really need to be addressed. I am thinking that when adding a component, there are combinations that would not make sense, like having straw walls with a concrete roof (extreme example I know).

Then in the complete house design use case there is more validation

I am guessing something can conform to the associations and multiplicities, but not be a valid house design, for instance only having 1 wall, unless the wall is circular , I am assuming there are other rules as to what combination of components makes a "Valid" house design, rather than just a house design that conforms to the business domain models multiplicity rules.

In other words the things that make a house design valid are business rules and can change

I am also assuming that although alternative flows are not shown in these use cases, we are expected to cover them in our sequence diagrams.

Remember in addition. If we have A (0..1) ---> (1) B. A cannot even exist without an instance of B, always does not just mean always when I hit validate. It means always. Thus there is no way to ever add a roof to a house only to replace a roof as it must always have 1. Likewise we can never just remove a roof. the house design must always have a roof.

I think I rambled a bit there, but hopefully you get what I am saying

Jason.
 
jQuery in Action, 2nd edition
 
subject: Factory Homes Revamp