Question

I'm designing and XML and oracle database based on following specification. The question looks confusing but it is very simple. I am trying to design UML diagram for following:

A multinational network of hotels owns the hotels in the countries all over the world. etc. The
network of hotels is described by a name and an address of its headquarters. An address of
headquarters consists of country, city, street and building number and it optionally includes
phone and email address.
The network has many hotels in many different countries. However each one of its hotels is
located in a different city. A hotel is described by a name and address that consists of country,
city, street and building number and it optionally includes phone and email address. A name of a
hotel together with a city name uniquely identifies each hotel, e.g. Sheraton at Suwa, or Holiday
Inn at Port Villa.

My problem is with first paragraph. When we say "The network of hotels is described by a name and an address of its headquarters."
Does it mean that one hotel can have one or more headquarter (because it say plural headquarters)? Is the following diagram is correct or I need to create another entity and define headquarters and then I should say "headquarters" contain "HOTEL"

enter image description here

Était-ce utile?

La solution

The diagram is almost correct I would just use a Composition or aggregation instead of an Association.

Autres conseils

This looks like a "homework" question. In case if it was a real task then you MUST get requirements clarified before serious analysis and design and coding takes place.

So in real world if a sentence from requirements is not clear then stop and get to your customer to make it clear to you.

In the "homework" world it looks to me like hotels and headquarters are completely two different things that may exist in completely different places and different buildings.

You can have headquarters in a business center in a big city with owner, secretary, accounting etc.

Then you can have 10 hotels at different vacation resorts spread near the sea.

For the modeling of headquarters I'd use hierarchical recursive tree-style data structure. As the structure of company owners, headquarters etc. should be very flexible. Company can be bought easily and its headquarters moved anywhere (at least from the point of law). Hotels on the other hand are physical entities that can not change it's address or move to another city once built from bricks, iron, glass..

For tips on how to model the headquarters data structure you can use Google or following old Stack Overflow related article Relationships in a UML class diagram

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top