Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code reuse
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== ===Software libraries=== A very common example of code reuse is the technique of using a [[Library (computer science)|software library]]. Many common operations, such as converting information among different well-known formats, accessing external storage, interfacing with external programs, or manipulating information (numbers, words, names, locations, dates, etc.) in common ways, are needed by many different programs. Authors of new programs can use the code in a software library to perform these tasks, instead of "re-inventing the wheel", by writing fully new code directly in a program to perform an operation. Library implementations often have the benefit of being well-tested and covering unusual or arcane cases. Disadvantages include the inability to tweak details which may affect performance or the desired output, and the time and cost of acquiring, learning, and configuring the library.<ref>{{Cite web|url=http://docforge.com/wiki/Code_reuse|title=Code reuse|access-date={{TODAY}}|work=DocForge|archive-url=https://web.archive.org/web/20110710143019/http://docforge.com/wiki/Code_reuse|url-status=dead|archive-date=2011-07-10}}</ref> ===Design patterns=== {{main article|Design pattern (computer science)}} A design pattern is a general solution to a recurring problem. Design patterns are more conceptual than tangible and can be modified to fit the exact need. However, abstract classes and interfaces can be reused to implement certain patterns. ===Frameworks=== {{main article|Software framework}} Developers generally reuse large pieces of software via third-party applications and frameworks, though frameworks are usually domain-specific and applicable only to families of applications{{citation needed|date=April 2015}}. ===Higher-order function=== {{main article|Higher-order function}} In [[functional programming]] higher-order functions can be used in many cases where design patterns or frameworks were formerly used. ===Retrocomputing=== [[Retrocomputing]] encompasses reuse of code, simply because retro programs are being run on older computers, or [[emulator]]s for them. ===Computer security=== In [[computer security]] code-reuse is employed as a software exploit method.<ref name=Bletsch11>{{Cite book| publisher = North Carolina State University| last = Bletsch| first = Tyler | title = Code-reuse Attacks: New Frontiers and Defenses| date = 2011 |isbn=978-1-124-75297-6 |url=http://dl.acm.org/citation.cfm?id=2338075}}</ref> When an attacker is not able to directly input code to modify the control flow of a program, for example in presence of code injection defenses such as [[W^X]], he or she can redirect the control flow to code sequences existing in memory. Examples of code-reuse attacks are [[return-to-libc attack]], [[return-oriented programming]], and jump-oriented programming.<ref name=Bletsch11/><ref>{{Cite conference| publisher = ACM| pages = 30β40| last1 = Bletsch| first1 = Tyler| last2 = Jiang| first2 = Xuxian| last3 = Freeh| first3 = Vince W| last4 = Liang| first4 = Zhenkai| title = Jump-oriented programming: a new class of code-reuse attack| book-title = Proceedings of the 6th ACM Symposium on Information, Computer and Communications Security| date = 2011| doi = 10.1145/1966913.1966919| url = https://web.comp.nus.edu.sg/~liangzk/papers/asiaccs11.pdf| isbn = 978-1-4503-0564-8| access-date = 2017-08-07| archive-url = https://web.archive.org/web/20170807154310/https://web.comp.nus.edu.sg/~liangzk/papers/asiaccs11.pdf| archive-date = 2017-08-07| url-status = dead}}</ref> ===Components=== {{main article|Software component}} A component, in an object-oriented extent, represents a set of collaborative classes (or only one class) and its interfaces. The interfaces are responsible for enabling the replacement of components. Reusable components can also be isolated and synchronized between SCM repositories using component source code management technologies ([https://github.com/teambit/bit CSCM]).{{citation needed|date=April 2015}} ===Outside computers=== The whole concept of "code reuse" can also encompass engineering applications outside software. For instance, [[Solid modeling|parametric modeling]] in [[computer-aided design]] allows for creating reusable designs. [[Standardization]] results in creation of interoperable parts that can be then reused in many contexts.{{citation needed|date=April 2015}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)