background preloader

Development termen

Facebook Twitter

Encapsulation (object-oriented programming) In programming languages, encapsulation is used to refer to one of two related but distinct notions, and sometimes to the combination[1][2] thereof: The second definition is motivated by the fact that in many OOP languages hiding of components is not automatic or can be overridden; thus, information hiding is defined as a separate notion by those who prefer the second definition. class Program { public class Account { private decimal accountBalance = 500.00m; public decimal CheckBalance() { return accountBalance; } } static void Main() { Account myAccount = new Account(); decimal myBalance = myAccount.CheckBalance(); /* This Main method can check the balance via the public * "CheckBalance" method provided by the "Account" class * but it cannot manipulate the value of "accountBalance" */ }} Below is an example in Java: Encapsulation is also possible in older, non-object-oriented languages.

Clients call the API functions to allocate, operate on, and deallocate objects of an opaque type. SOLID (object-oriented design) In computer programming, SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the "first five principles" named by Robert C. Martin[1][2] in the early 2000s[3] that stands for five basic principles of object-oriented programming and design. The principles when applied together intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.[3] The principles of SOLID are guidelines that can be applied while working on software to remove code smells by causing the programmer to refactor the software's source code until it is both legible and extensible.

It is part of an overall strategy of agile and adaptive programming.[3] Data access object. Although this design pattern is equally applicable to most programming languages, most types of software with persistence needs, and most types of databases, it is traditionally associated with Java EE applications and with relational databases accessed via the JDBC API because of its origin in Sun Microsystems' best practice guidelines[1] ("Core J2EE Patterns") for that platform. Advantages[edit] The advantage of using data access objects is the relatively simple and rigorous separation between two important parts of an application that can and should know almost nothing of each other, and which can be expected to evolve frequently and independently. Changing business logic can rely on the same DAO interface, while changes to persistence logic do not affect DAO clients as long as the interface remains correctly implemented.

Tools and frameworks[edit] See also[edit] References[edit] ValueObject. Domain driven design · API design tags: In P of EAA I described Value Object as a small object such as a Money or date range object. Their key property is that they follow value semantics rather than reference semantics. You can usually tell them because their notion of equality isn't based on identity, instead two value objects are equal if all their fields are equal. Although all fields are equal, you don't need to compare all fields if a subset is unique - for example currency codes for currency objects are enough to test equality.

A general heuristic is that value objects should be entirely immutable. If you want to change a value object you should replace the object with a new one and not be allowed to update the values of the value object itself - updatable value objects lead to aliasing problems. Early J2EE literature used the term value object to describe a different notion, what I call a Data Transfer Object. Data transfer object. Data transfer object (DTO)[1][2] is an object that carries data between processes. The motivation for its use has to do with the fact that communication between processes is usually done resorting to remote interfaces (e.g. web services), where each call is an expensive operation.[2] Because the majority of the cost of each call is related to the round-trip time between the client and the server, one way of reducing the number of calls is to use an object (the DTO) that aggregates the data that would have been transferred by the several calls, but that is served by one call only.[2] See also[edit] This pattern is often incorrectly used outside of remote interfaces.

This has triggered a response from its author[3] where he reiterates that the whole purpose of DTOs is to shift data in expensive remote calls. See also[edit] Value object Note: A Value object is not a DTO. References[edit] External links[edit]

DDD Domain Driven Design

Orm Object-relational mapping / Object Role Modeling ? SOA Service Oriented Architecture. Dao / sdo / sca / das. Lazy Loading. An object that doesn't contain all of the data you need but knows how to get it. For a full description see P of EAA page 200 For loading data from a database into memory it's handy to design things so that as you load an object of interest you also load the objects that are related to it. This makes loading easier on the developer using the object, who otherwise has to load all the objects he needs explicitly. However, if you take this to its logical conclusion, you reach the point where loading one object can have the effect of loading a huge number of related objects - something that hurts performance when only a few of the objects are actually needed.

A Lazy Load interrupts this loading process for the moment, leaving a marker in the object structure so that if the data is needed it can be loaded only when it is used. As many people know, if you're lazy about doing things you'll win when it turns out you don't need to do them at all. There are four main varieties of lazy load. Lazy Loading with External PHP Iterators. The fun side of outer iterators (at least when using an OOP approach) is that their implementation is (in most cases) a straightforward process that can be mastered in a snap. Of course, claming this without concrete proof would be rather pointless. In line with this idea, in previous installments of this series I went through the development of a couple of concrete examples that demonstrated how to use an external iterator for traversing the protected fields of a class whose primary use was to model generic entities.

In the first tutorial, the whole traversing task was performed via a custom array collection, while the second how-to achieved the same process through the native ArrayIterator class bundled with the SPL. In both cases, the results were nearly identical, even though the use of a built-in class like ArrayIterator, saved us from the hassles of having to write an array wrapper all by ourselves. Traversing Array Elements: Building a Custom Array Collection Pretty simple right? CRUD: creating, reading, updating, deleting. CRUD is een afkorting uit de informatica die staat voor de vier basisoperaties die op duurzame gegevens (meestal een database) uitgevoerd kunnen worden. Deze zijn: Create (of insert): Toevoegen van nieuwe gegevens.Read (of select): Opvragen van gegevens.Update: Wijzigen van gegevens.Delete: Verwijderen van gegevens. Vrijwel elk softwareprogramma maakt gebruik van de CRUD-functionaliteit.

CRUD-matrix[bewerken] Een CRUD-matrix legt de relaties vast tussen data-objecten (tabellen in een relationele database) en systeemfuncties. CRUD-matrices (of tabellen) kunnen gebruikt worden als een hulpmiddel voor de compleetheidscontrole van een logisch informatie- of datamodel. Gegevenscyclustest[bewerken] Een CRUD-matrix is ook nodig als er een gegevenscyclustest moet worden uitgevoerd.

Geschiedenis[bewerken] DRY: Don't repeat yourself. Applying DRY[edit] DRY vs WET solutions[edit] Violations of DRY are typically referred to as WET solutions, which is commonly taken to stand for either "write everything twice" or "we enjoy typing".[2][3] See also[edit] References[edit] External links[edit]