The code reuse , also called reused software , is the use of existing software, or software knowledge, to build new software, following the principles of reuse.
Video Code reuse
Ikhtisar
The reuse of ad hoc code has been practiced since the early days of programming. Programmers always reuse parts of code, templates, functions, and procedures. The software is reused as a recognized field of study in software engineering, however, only from 1968 when Douglas McIlroy of Bell Laboratories proposed basing the software industry on reusable components.
The code reuse aims to save time and resources and reduce redundancy by taking advantage of assets that have been made in some form in the software product development process. The key idea in reuse is that part of a computer program written at one time can or should be used in the construction of another program written at a later time.
Reusing the code may imply the creation of separate versions of reusable assets. Although code is the most commonly selected resource for reuse, other assets generated during the development cycle may offer opportunities for reuse: software components, test space, design, documentation, and so on.
Library software is a good example for code reuse. Programmers may decide to create an internal abstraction so that certain parts of their program can be reused, or can create custom libraries for their own use. Some of the characteristics that make software easier to reuse are modularity, loose coupling, high cohesion, information concealment and separation of worries.
For newly written code to use an existing piece of code, some type of interface, or means of communication, must be defined. This usually includes "calls" or the use of subroutines, objects, classes, or prototypes. In organizations, such practices are formalized and standardized by domain engineering, also known as software product engineering.
The common practice of using an earlier version of an existing program as a starting point for the next version, is also a form of code reuse.
Some code called "reuse" involves simply copying some or all of the code from an existing program to a new one. While organizations can realize the time to market benefits for new products with this approach, they can then be loaded with many of the same code duplication problems caused by cut and paste programming.
Many researchers have worked to make reuse faster, easier, more systematic, and an integral part of the normal programming process. These are some of the main goals behind the discovery of object-oriented programming, which is one of the most common forms of formal reuse. A somewhat later discovery is generic programming.
Another newer way is to use "generator" software, a program that can create a new program of a certain type, based on a set of user-selected parameters. Field studies of such systems are generative programming and metaprogramming.
Maps Code reuse
Reusable type
Regarding motivation and driving factors, reuse may be:
- Opportunistic - When preparing to start a project, the team realizes that there are components that they can reuse.
- Planned - The team strategically designs components for reuse in future projects.
Reusing can be further categorized:
- Internal reuse - A team reuses its own components. This may be a business decision, as the team may want to control the critical components for the project.
- External reuse - The team may choose to license third-party components. Third party component licenses typically cost teams 1 to 20 percent of what it would cost to develop internally. The team should also consider the time it takes to discover, study, and integrate components.
Regarding the form or structure of reuse, the code can be:
- Referenced - The client code contains references for code reuse, and thus they have different life cycles and can have different versions.
- Branded - The client code contains local or private copies of the reused code, so they share one lifecycle and one version.
Redirecting the fork is often discouraged because it is a duplicate of code, requiring each bug to be corrected in every copy, and refinements made to reuse the code must be manually merged on each copy or become invalid. However, re-forking can have benefits such as isolation, the flexibility to change reused code, easier packaging, deployment, and version management.
Systematic
Systematic software reuse is a strategy to increase productivity and improve the quality of the software industry. Although the concept is simple, successful implementation of software reuse is difficult. The reason being asked for this is the dependency of software reuse in the context in which it is applied. Some of the problematic issues that need to be addressed regarding systematic reuse of software are:
- Clear and well-defined product vision is an important foundation for SPL.
- an evolutionary implementation strategy would be a more pragmatic strategy for the company.
- there is a need for ongoing management support and leadership to ensure success.
- Appropriate organizational structures are required to support SPL engineering.
- the change of mindset from a project-centered company to a product-oriented company is important.
Example
Software library
A very common use of code is techniques using software libraries. Many common operations, such as changing information between various well-known formats, accessing external storage, interacting with external programs, or manipulating information (numbers, words, names, locations, dates, etc.) In general ways, it takes many different. program. New program authors can use the code in the software library to perform these tasks, rather than "reinventing the wheel", by writing the new code entirely directly in the program to perform the operation. Implementation libraries often have proven benefits, and include unusual or mysterious cases. Disadvantages include the inability to alter details that may affect desired performance or output, and the time and cost to acquire, study, and configure libraries.
Design pattern
Design patterns are common solutions to recurring problems. Design patterns are more conceptual than real and can be modified to fit the exact needs. However, abstract classes and interfaces can be reused to implement certain patterns.
Framework
Developers generally reuse large software through third-party applications and templates. Although the framework is usually domain-specific and applies only to app families.
High-order function
In the functional functional functional programming function can be used in many cases where previous design patterns or frameworks are used.
Retrocomputing
Retrocomputing includes code reuse, simply because retro programs run on older computers, or emulators for them.
Computer security
In the reuse of computer security code is used as a method of software exploitation. When an attacker can not directly enter the code to change the control flow of a program, for example with the defense of code injection like W? X, it can direct the control flow to the code sequence that is in memory.
Examples of reuse-code attacks are return-to-libc attacks, re-oriented programming, and jump-oriented programming.
Components
A component, in an object-oriented level, represents a set of collaborative classes (or just one class) and its interfaces. The interface is responsible for allowing component replacement. Reusable components can also be isolated and synchronized between SCM repositories using component source code management (CSCM) technologies.
Outside computer
The whole concept of "code reuse" can also include engineering applications outside the software. For example, parametric modeling in computer-aided design makes it possible to create reusable designs. The result of standardization in the creation of interoperable parts which can then be reused in many contexts.
Criticism
The reuse code generates a dependency on the reused component. Rob Pike argues that "Little copying is better than a little bit of dependency". When he joined Google, the company was very focused on reusing the code. He believes that Google's code base still suffers the result of previous policies in terms of speed and maintenance of compilations.
See also
- Do not repeat yourself
- ICSR
- Inheritance
- Language binding
- Not found here (antonyem)
- Polymorphism
- Procedural programming
- Rediscover the wheel (antonym)
- Reusable
- Reuse metrics
- One truth source
- Software framework
- Virtual relics
References
External links
- ReNews - site information on software reuse and domain engineering
- Software Reuse Tips Article
Source of the article : Wikipedia
