A software design pattern used to enhance the functionality of an object at run-time is:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. Decorator
Explanation
The Decorator pattern wraps an object in another object that implements the same interface and adds behaviour before or after forwarding the call, so responsibilities can be attached to an individual object dynamically at run time without subclassing. Adapter does not add functionality; it converts one interface into another so incompatible classes can work together. Proxy also keeps the same interface but controls access to the object (lazy loading, remote access, protection) rather than enhancing its behaviour. Delegation is a general object-oriented technique, not one of the GoF patterns. Hence Decorator.More Software Engineering questions
- Module design is used to maximize cohesion and minimize coupling. Which of the following is the key to implement this rule?
- The design concept 'Refinement' is a:
- A software design is highly modular if:
- Cohesion is an extension of:
- A company has a choice of two languages L1 and L2 to develop a software for their client. Number of LOC required to develop an application…
- Assume that a software system P is to be developed with the following parameters: Estimated size of the software: 33,480 LOC Productivity:…