public interface
   HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
, a public interface is the logical point at which independent
software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consists ...
entities interact. The entities may interact with each other within a single computer, across a network, or across a variety of other
topologies In mathematics, topology (from the Greek words , and ) is concerned with the properties of a geometric object that are preserved under continuous deformations, such as stretching, twisting, crumpling, and bending; that is, without closing ho ...
. It is important that public
interfaces Interface or interfacing may refer to: Academic journals * Interface (journal), ''Interface'' (journal), by the Electrochemical Society * ''Interface, Journal of Applied Linguistics'', now merged with ''ITL International Journal of Applied Lin ...
will be stable and designed to support future changes, enhancements, and deprecation in order for the interaction to continue.


Design


Guidance

A project must provide additional documents that describe plans and procedures that can be used to evaluate the project’s compliance. * architecture design document. *
coding standards Coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language. These conventions usually cover file organization, in ...
document. *software release plan document. *document with a plan for deprecating obsolete interfaces. The programmer must create fully insulated classes and insulate the public interfaces from
compile-time In computer science, compile time (or compile-time) describes the time window during which a computer program is compiled. The term is used as an adjective to describe concepts related to the context of program compilation, as opposed to concept ...
dependencies.


Best practices

*Present complete and coherent sets of
concept Concepts are defined as abstract ideas. They are understood to be the fundamental building blocks of the concept behind principles, thoughts and beliefs. They play an important role in all aspects of cognition. As such, concepts are studied by s ...
s to the user. *Design interfaces to be statically typed. *Minimize the interface’s dependencies on other interfaces. *Express interfaces in terms of application-level types. *Use assertions only to aid development and integration.


Example


C++ interface

::Use protocol classes to define public interfaces. ::The characteristics of a protocol class are: ::*It neither contains nor inherits from classes that contain member data, non-virtual functions, or private (or protected) members of any kind. ::*It has a non-inline virtual destructor defined with an empty implementation. ::*All member functions other than the destructor, including inherited functions, are declared pure virtual and left undefined. ::Benefits ::The benefits of using protocol classes include: ::*Insulating applications from the external client ::*Insulating changes that are internal to the interface ::*Insulating changes to the public interface from changes to the implementation of the interface ::*Insulation has costs, but these tend to be outweighed by the gains in
interoperability Interoperability is a characteristic of a product or system to work with other products or systems. While the term was initially defined for information technology or systems engineering services to allow for information exchange, a broader defi ...
and reusability. ::Costs: ::*Going through the implementation pointer ::*Addition of one level of indirection per access ::*Addition of the size of the implementation pointer per object to memory requirements


Other information

Various
methodologies In its most common sense, methodology is the study of research methods. However, the term can also refer to the methods themselves or to the philosophical discussion of associated background assumptions. A method is a structured procedure for bri ...
, such as
refactoring In computer programming and software design, code refactoring is the process of restructuring existing computer code—changing the '' factoring''—without changing its external behavior. Refactoring is intended to improve the design, structure ...
, support the determination of interfaces. Refactoring generally applies to the entire software implementation, but is especially helpful in properly flushing out interfaces. There are other approaches defined through the pattern community.{{Cite web , title=Design Patterns Library , url=https://hillside.net/patterns/ , access-date=2022-11-24 , website=hillside.net


References

Software architecture