public interface
   HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, a public interface is the logical point at which independent
software Software consists of computer programs that instruct the Execution (computing), execution of a computer. Software also includes design documents and specifications. The history of software is closely tied to the development of digital comput ...
entities interact. The entities may interact with each other within a single computer, across a network, or across a variety of other topologies. It is important that public
interfaces Interface or interfacing may refer to: Academic journals * ''Interface'' (journal), by the Electrochemical Society * '' Interface, Journal of Applied Linguistics'', now merged with ''ITL International Journal of Applied Linguistics'' * '' Inter ...
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 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 language's statements are converted into binary instructions for the processor to execute. The term is used as an adjective to describe concepts relat ...
dependencies.


Best practices

*Present complete and coherent sets of
concept A concept is an abstract idea that serves as a foundation for more concrete principles, thoughts, and beliefs. Concepts play an important role in all aspects of cognition. As such, concepts are studied within such disciplines as linguistics, ...
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 de ...
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 source 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