repl.it
link
Reuse is a major theme in software engineering practices. By reusing tried-and-tested components, the robustness of a new software system can be enhanced while reducing the manpower and time requirement. Reusable components come in many forms; it can be reusing a piece of code, a subsystem, or a whole software.
While you may be tempted to use many libraries/frameworks/platform that seem to crop up on a regular basis and promise to bring great benefits, note that there are costs associated with reuse. Here are some:
Exercises
Using a cool UI framework
One of your teammates is proposing to use a recently-released “cool” UI framework for your class project. List the pros and cons of this idea.
Pros
Cons
Note that having more cons does not mean you should not use this framework. Further investigation is required before you can make a final decision.
An Application Programming Interface (API) specifies the interface through which other programs can interact with a software component. It is a contract between the component and its clients.
A class has an API (e.g., API of the Java String
class, API of the Python str
class) which is a collection of public methods that you can invoke to make use of the class.
The GitHub API is a collection of Web request formats GitHub server accepts and the corresponding responses. You can write a program that interacts with GitHub through that API.
When developing large systems, if you define the API of each components early, the development team can develop the components in parallel because the future behavior of the other components are now more predictable.
Exercises
Statements about APIs
Choose the correct statements
(a) (c) (d) (e)
Explanation: (b) is incorrect because private methods cannot be a part of the API
True or False?
Defining component APIs early is useful for developing components in parallel.
True
Explanation: Yes, once you know the precise behavior expected of each component, you can start developing them in parallel.