• Post Reply Bookmark Topic Watch Topic
  • New Topic

Part 2 - wrong relationship in domain model?  RSS feed

 
Paul Moreau
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm working on assignment Utility International. There is a composition relationship between gas bill and gas units in the domain model. The domain model shows gas bill is a part of gas units, which I think the relationship should be opposite, gas units is a part of gas bill.

Can I assume that this relationship is incorrect in the domain model? Does anybody have same concern as me?

I hope this post does not violate Oracle rules, if so, please remove it
 
Bjoern Carl
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

I just started working on the very same assignment and to me, the given domain model does not make sense at that point, either.
The only explanation I have is:
"Gas Units result in a Gas Bill" so that if there are no gas units (i.e. the customer hasn't booked a "gas package"), there will be no gas bill.

Secondly, I modelled the Monthly Bill to be abstract, so there will be separated bills for gas, water and electricity. But the use case "Calculate Bill" describes that for each user, a total bill is generated.
I'm a little confused here, too.

Any suggestions?

P.S.: I know it is possible to change the domain model but maybe I just don't get the intention of it.
 
Bjoern Carl
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The more I think about the domain model, the more I have troubles understanding it. It seems to me that it doesn't match the textual descriptions.

1) I modelled the Monthly Bill to be abstract, so there will be separate bills for gas, water and electricity. But the use case "Calculate Bill" describes that for each user, a total bill is generated. If I model it as a concrete class, the generalization from GasBill, WaterBill and ElectricityBill to MonthlyBill doesn't make sense anymore. Instead I would add a TotalBill with associations to each of the bill types.

2) Does the external billing module have access to my persistence layer? It's said to communicate via web service but the use case calculate bill states it's called by an external call (web service) and "retrieves" the required information to calculate the total bill per user.

3) How does the "Customer Usage" relate to the customer as long as the bill does not exist?

4) Shouldn't the User class be an @Entity bean? Cades working solution is missing that.

Thanks for any help!
 
amine ouali alami
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
After one week of reflection, i have exactly the same doubt

1 )I modelled the Monthly Bill to be abstract, so there be separated bills (GAZ , WATER and electricity) even if the CALCULATE BILL describes generate BILL for each Customer. what do you think ?
2 )I'm totally confused here, the billing system is already installed like they say is workshop output, in this case why it is present in the use case calculate bill ?
3 )i think to add a relation between a Customer and Customer Usage, they say in the assignment to respect the relation ship between the objects. it is ok to add a relation not present in the domain model ?

Thanks fo your help
 
amine ouali alami
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amine ouali alami wrote:Hi ,
After one week of reflection, i have exactly the same doubt

1 )I modelled the Monthly Bill to be abstract, so there be separated bills (GAZ , WATER and electricity) even if the CALCULATE BILL describes generate BILL for each Customer. what do you think ?
2 )I'm totally confused here, the billing system is already installed like they say in the workshop output, in this case why it is present in the use case , the billing system is a part of the SUD ?
3 )i think to add a relation between a Customer and Customer Usage, they say in the assignment to respect the relation ship between the objects. it is ok to add a relation not present in the domain model ?

Thanks fo your help
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!