0% found this document useful (0 votes)
13 views

HowTo CreateAnObjectDiagram

This document discusses using object-oriented analysis to model a cinema schedule using objects and classes. It identifies three Movie objects with attributes like title and duration. It determines that showing date/time and cinema hall are not attributes of Movie, but require a separate Show object that associates a Movie with a date/time and cinema hall. It also identifies reusable objects like AgeRating and FilmGenre that can be pre-defined through enumeration. The solution is to create classes for Movie, Show, CinemaHall, AgeRating and FilmGenre and draw an object diagram to model the cinema schedule using these classes.

Uploaded by

Ashish Ghaskata
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

HowTo CreateAnObjectDiagram

This document discusses using object-oriented analysis to model a cinema schedule using objects and classes. It identifies three Movie objects with attributes like title and duration. It determines that showing date/time and cinema hall are not attributes of Movie, but require a separate Show object that associates a Movie with a date/time and cinema hall. It also identifies reusable objects like AgeRating and FilmGenre that can be pre-defined through enumeration. The solution is to create classes for Movie, Show, CinemaHall, AgeRating and FilmGenre and draw an object diagram to model the cinema schedule using these classes.

Uploaded by

Ashish Ghaskata
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Case study: Cinema

How to create an object diagram using the example of an cinema-schedule (Cineplex)

The object-oriented analysis (OO analysis) helps to identify the structure and to specify all necessary
information for a specific IT application by defining objects as carriers for information. The concrete
data is stored in the values of the attributes of these objects; certain types (classes) of objects are
responsible for their specific associated information, which leads to a meaningful structure of object
types (classes) to model the entire, sometimes highly complex, application.

In the section of the cinema program shown, one can obviously recognize 3 different movies and thus
3 independent objects (instances/examples) of the type Movie. The most important attributes are
immediately identifiable: a title, a short synopsis, the duration of the film in minutes, an age
restriction (FSK) and assigned movie genres.

Note! The timestamp specified in the schedule (date plus time) and the associated cinema hall are not
attributes of a movie. That would be a highly useless structuring of the information. Why? One unique
instance of movie – now we need to differentiate between the terms identity and equality – can be
shown as often as you like (generalization of the example shown). This means that the appointment
attribute cannot simply be a date/time of object Movie. Now some students could come up with the
idea of storing not just one appointment for this attribute, but a whole list of dates/times:

Appointments = [(05/03/2020 10:30), (05/03/2020 13:30), (05/03/2020 10:30), …]


Something like this is possible in principle, see data type List<DateTime>; but then it is impossible to
assign the associated cinema hall to the respective dates. It takes some experience to recognize that
there is a specialized object needed: the Show. So please don't give up if you didn't think of it the first
time.

Solution: You need to realize that additional types of objects are needed to structure the relevant
information in a meaningful way. An object of type Show will be responsible for the what (movie),
when (date/time) and where (cinema/hall). Movies and cinema halls are independent objects. The
cinema hall for example is clearly identifiable, has attributes (e.g. size, equipment, ...) and is multiply
reused as a non-mutable object in other shows. The show on the other side has three attributes:
movie, cinema hall and the date/time appointment. An object of the Show class thus brings together
two other objects, movie and cinema hall, and also assigns an appointment to this pair. We call such
an object type an associative class.

Reusability: Finally, it is helpful to model already (at the time of the analysis) fixed terms as non-
mutable objects so they can be reused in a bigger context. These for example are the object types
“age rating” and “film genre”. The special feature of these object types (classes) is that we can
enumerate the possible objects here and now – this is called enumeration:

Age rating: None, 6+, 12+, 16+, 18+

Film genre: children's film, cartoon, drama, action, sci-fi, horror, ...

Using the object types described here, the appropriate object diagram has been created (see
solution). Note the standardized UML notation, which you can find in many sources (including
textbooks).

You might also like