Programming paradigm. Data-driven programming. Data-driven design. Active object. The pattern consists of six elements: See also References Jump up ^ Douglas C.
Schmidt; Michael Stal; Hans Rohnert; Frank Buschmann (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects. Meemoo project by Forrest Oliphant. Semantic-oriented programming. Common features The way of how these semantic information are represented in the system vary according to the approach chosen (see below), common to these approaches are the following features: Goals The goals of SOP are: Improving the maintainability of a softwareImproving the transparency of a softwareFlexibility by allowing exchangeability of logic and/or implementationOptimal support for agile development processes (refactoring) SOPlets Soplets is a method of describing semantic concepts as blocks of code, using existing features of the (Java) language, namely annotations and enumerations.
Soplets can be referenced and used from anywhere inside the code. A Soplet may be enhanced by one or more (stateless) functions, which are directly attached to the code block.
Object-oriented programming. Overview Rather than structure programs as code and data, an object-oriented system integrates the two using the concept of an "object".
An object has state (data) and behavior (code). Objects correspond to things found in the real world. So for example, a graphics program will have objects such as circle, square, menu. An online shopping system will have objects such as shopping cart, customer, product. Object-oriented design. Object-oriented design is the process of planning a system of interacting objects for the purpose of solving a software problem.
It is one approach to software design. Overview What follows is a description of the class-based subset of object-oriented design, which does not include object prototype-based approaches where objects are not typically obtained by instancing classes but by cloning other (prototype) objects. Responsibility-driven design. Responsibility-driven design is a design technique in object-oriented programming.
It was proposed by Rebecca Wirfs-Brock and Brian Wilkerson, who defined it as follows: Responsibility-driven design is inspired by the client/server model. It focuses on the contract by asking:What actions is this object responsible for? What information does this object share? Logic programming. Logic programming is a programming paradigm based on formal logic.
Programs written in a logical programming language are sets of logical sentences, expressing facts and rules about some problem domain. Together with an inference algorithm, they form a program. Major logic programming languages include Prolog and Datalog. A form of logical sentences commonly found in logic programming, but not exclusively, is the Horn clause. An example is: Imperative programming. The term is used in opposition to declarative programming, which expresses what the program should accomplish without prescribing how to do it in terms of sequences of actions to be taken.
Functional and logic programming are examples of a more declarative approach. Imperative, procedural, and declarative programming Event-driven programming. Event handlers A trivial event handler Because the code for checking for events and the main loop do not depend on the application, many programming frameworks take care of their implementation and expect the user to provide only the code for the event handlers.
In this simple example there may be a call to an event handler called OnKeyEnter() that includes an argument with a string of characters, corresponding to what the user typed before hitting the ENTER key. To add two numbers, storage outside the event handler must be used. Event loop. When the event loop forms the central control flow construct of a program, as it often does, it may be termed the main loop or main event loop.
This title is appropriate because such an event loop is at the highest level of control within the program. Message passing Alternative designs This approach is in contrast to a number of other alternatives: Structured programming. It emerged in the 1960s—particularly from work by Böhm and Jacopini, and a famous letter, Go To Statement Considered Harmful, from Edsger Dijkstra in 1968—and was bolstered theoretically by the structured program theorem, and practically by the emergence of languages such as ALGOL with suitably rich control structures.
Low-level structured programming At a low level, structured programs are often composed of simple, hierarchical program flow structures. These are sequence, selection, and repetition: Graphical representations of the three basic patterns. The box diagrams (blue) were invented right for the new theory, and you can see here their equivalents in the mostly used control flow charts. Procedural programming. Procedures and modularity Scoping is another technique that helps keep procedures strongly modular. It prevents the procedure from accessing the variables of other procedures (and vice-versa), including previous instances of itself, without explicit authorization. Because of the ability to specify a simple interface, to be self-contained, and to be reused, procedures are a convenient vehicle for making pieces of code written by different people or different groups, including through programming libraries.