D.1.5 Describe the process of decomposition into several related objects.
Decomposition in computer science, also known as factoring, is breaking a complex problem or system into parts that are easier to conceive, understand, program, and maintain.
Brainstorming (Brainstorming to locate possible classes)
the stage in which we make a first pass at determining the classes in the problem.
Filtering (Filtering the classes to find duplicates or remove unnecessary ones)
the stage in which we go back over the proposed classes determined in the brainstorming stage to see if any can be combined or if any are missing.
Each class that survives the filtering stage is examined more carefully in the next stage.
Scenarios (Scenarios are tried to be sure we understand collaborations)
is the stage in which the behaviour (methods/functions) of each class is determined. Because each class is responsible for its own behaviour, we call these behaviours responsibilities
Responsibility algorithms: (Responsibility algorithms are designed for all actions that classes must exhibit)
a stage in which the algorithms are written for the responsibilities for each of the classes.
You can break the problem to solve into smaller chunks and deal with them one at a time. This makes it much easier to deal with a complex problem.
In structured programming, algorithmic decomposition breaks a process down into well-defined steps.
Structured analysis breaks down a software system from the system context level to system functions and data entities
Object-oriented decomposition, on the other hand, breaks a large system down into progressively smaller classes or objects that are responsible for some part of the problem domain.
According to Booch, algorithmic decomposition is a necessary part of object-oriented analysis and design, but object-oriented systems start with and emphasize decomposition into classes.
Computer programmers do exactly the same thing. When they are writing a program they often break the code into small chunks.
They call this approach 'decomposition' because you are ‘decomposing’ or breaking down a large problem into smaller problems.
Decomposition saves a lot of time: the code for a complex program could run to many lines of code. If a mistake was made it would take a very long time to find.
Another benefit to decomposition is that it allows programmers to easily copy and reuse useful chunks of code for other programs.
Decomposition is a useful problem-solving strategy. It can help you write a complex computer program, plan a holiday or make a model plane.
Computer programmers decompose their code into small parts. If they are programming a computer game they might write the code to control a character's movement and then write the code to control sound effects.