Looking for Object-oriented Analysis & Design with UML - EFREI - Fall 2025 test answers and solutions? Browse our comprehensive collection of verified answers for Object-oriented Analysis & Design with UML - EFREI - Fall 2025 at moodle.lab.ii.agh.edu.pl.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
1. If you want to represent part-whole object hierarchies.
or
2. When you want clients to be able to ignore differences between object assemblies and individual objects. Clients will then treat all objects in the structure in the same way.
you will apply
The consequences of which pattern are:
1. Allows you to define hierarchies consisting of simple and complex objects. Simple objects can be composed into complex objects, which can also be combined with each other, etc. In the client code, wherever a simple object is expected, a complex object can also be provided.
2. Simplifies clients' code. Customers can treat complex structures and individual objects in the same way. Typically, clients cannot tell whether they are using a leaf or a compound component (and it shouldn't matter). This simplifies client code because you don't have to write complicated functions that check the classes that define the assemblies.
1 If there must be exactly one instance of the class available to clients at a known location.
or
2. When the ability to extend a single instance by creating subclasses is needed, and clients should be able to use the enriched instance without having to make changes to their code.
you will apply
The composite pattern is an example of a pattern from the group:
Provide a valid class link name for the following description:
We have a forest class that consists of trees.
A tree may belong to only one forest, or it may not belong to any forest. A forest consists of at least two trees.
Provide the correct class multiplicity for the description below:
No river need flow through the state, but many rivers may well flow through it. The river must flow through at least one state.
The generalization is presented in the figure below:
Provide the correct class multiplicity for the description below:
A river segment belongs to exactly one river, but the river must consist of at least one segment.
The specialization is shown in the figure below:
Provide a valid class link name for the following description:
We have a river class that consists of segments.
A river segment belongs to exactly one river, but the river must consist of at least one segment.