1.1 Models

Modeling is not specific to computer science. Traditionally modeling is used in a number of areas such as architecture, science, and engineering. In general, models may be used to study and analyze properties of systems, and descriptions of models are used for communication between scientists, engineers, designers, and others.

Models are used for different purposes depending on the area.

One class of models is constructed to understand properties of systems, including parts of nature. The picture to the left shows a model of the planets made by an astronomer with the purpose of studying properties of the movement of planets around the sun.

Another class of models is made to analyze properties of the design of a planned system, before the system is built, and to check that the system design has certain required properties.

An architect may e.g. construct a model of a new building in order to show to customers how the building will look like. This may be a physical model of paper and wood, or a model inside a computer.

Models versus descriptions of models

The following example of a model illustrate the difference between a model and the description of the model. 

Most people are familiar with building toy models using LEGO bricks. The figure below shows a picture of a Morris Mini and a model of the Mini made from LEGO bricks.

The box of LEGO Bricks to be used for building the model usually contains an instruction manual, which is a description of how to build the model in the form of a list of instructions.

The design of computer-based models is analogous to building models using LEGO bricks. Instead of LEGO bricks, we use objects as the material for building the models. Objects may be conceived as a kind of physical material that exists as parts of models within the computer – quite analogous to LEGO bricks.

A program is analogous to an instruction manual for building a LEGO model, since a program also describe how the computer builds the model. 

As mentioned above, a model may be of an existing system, like the solar system, or of an idea of a planned system like a building being designing by an architect. In programming, both of these situations may appear. 

You may construct a computer-based model of an existing system. This may happen when you digitize manual systems, processes, etc. of a company, hospital, etc.; you may also create systems for simulating physical systems like the weather, flooding, or the spreading of diseases; you may create systems for analyzing large amounts of data like is done in artificial analysis; and many more.

You may construct a model of a new system that you imagine. Examples of this are computer games, email systems, video conference systems, online banking, and telemedicine.

However, in most cases when you create computer-based models it is a mixture of modeling elements of an existing system and adding new imaginary elements.  And eventually such a model turns becomes a real system in itself and all ties/references to the original existing   system may have vanished.

An example of a computerized model 

We have above introduced objects as computerized material for making models, just like LEGO bricks are material for making LEGO models.

Figure xxx illustrates this for the model of a planned flight reservation system. Within the model there will be objects representing the different flights. For each reservation there is a Ticket object, with properties that tell which flight, the name of the passenger, and the date. As part of the reservation a seat has been reserved, and that is represented by a Seat object.