When we went though this is class i had 0 clue and now I could do with some help on this example.
Also if you can explain what Abstraction and automation actually are/mean that would be very helpful
A holiday tour business wants to create a new computer system. They offer 30 different tours every year, each of which can have up to 50 people on it. The tour company organises the travel and hotel arrangements and lays on a number of excursions. The company needs to organise tour guides to accompany its customers and manage all of the payments from customers and to suppliers.
These are the questions I'm struggling with to do with the above statement (and why I'm struggling)
a) Explain how you could use abstraction by generalisation or categorisation to break this problem down
- I know this definition of abstraction by generalisation/categorisation: Reducing problems by categorising similar aspects of a problem into a hierarchy. But I cant understand what it means to do what similar parts and how does that solve reduce the number of problems?
b)Produce a hierarchy chart to show how you could decompose this problem
- Whats a hierarchy chart
This whole topic is weird and confusing thanks for reading/helping
Turn on thread page Beta
Abstraction and automation - please help me watch
- Thread Starter
- 01-11-2016 15:40
- 05-11-2016 19:49
UML provides a well established hierarchy diagram and is worth learning.
You only need to remember three relationships.
Generalisation is the "is a" relationship. So in your example the tour company offers different Tours. Tours may be specialised so you might have a Safari Tour, a Polar Tour and a City Tour, each of which specialise the Tour class. A Safari Tour "is a" Tour. In code, this is inheritance.
To be honest - I have never heard of categorisation. However, in UML the other main relationship is "has a" which is the composition relationship. So in your example, a Tour "has a" person on it and in this particular example, there is a one-to-many relationship between Tour and Person i.e. one Tour - lots of Persons. The might be represented in code as a Tour class having an attribute or member variable that is an array of Person objects.
The final relationship is one of dependency. In your example, you need to assign tour guides to groups of people. A tour guide isn't a person (Generalisation), nor does a tour guide "have a" person (composition), but a tour guide does have one to many dependency on one or more Person objects. In your code, this might be a dictionary variable in the TourCompany class that uses the TourGuide as the key and an array of Person objects as the value.
The best way to start with hierarchy charts is to define your entities which is usually anything that is a noun. So we have Person, Tour, TourCompany, TourGuide and so on. Then just draw some lines as you see them connected. Feel free to use the UML notation. It really is pretty simple and helps clarify much.