Lecture 10 Flashcards
What are three types of reuse?
- Libraries
- Toolkits frameworks
- Components
Reuse, what is a library?
-reusable, importable code, typically single purpose
E.g.: OpenGL, OpenCV
Functionality accessed through the API.
Reuse, what is a framework?
A framework is a set of cooperating classes that make up a reusable design for a specific class of software
Frameworks permit realization or specialization primarily by subclassing at “well-articulated extension points
Reuse, what is a component?
multiple use, non-context-specific, composable, encapsulated, independently deployed and versioned (Szyperski and Messerschmitt, 2002)
Vaadin widgets are an example of components
What is a collection?
a group of objects
What is a list?
A collection that is ordered by a numerical
index. Duplicate elements are possible.
What is a set?
A collection that permits no duplicates. A set may or may not be ordered.
What is a map?
A collection that links keys to corresponding values. Keys may or may not be ordered.
What is the iterator pattern?
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
What is the adaptor pattern?
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.
American plug, adapter, European socket
(NASA/SpaceX adapter example)
What is the proxy pattern?
Provide a surrogate or placeholder for another object to control access to it.
What is the decorator pattern?
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extended functionality.