Object composition

This product was added to computer science because of the content, defects on the quality assurance side of the editor. This is done to bring the quality of the articles from the computer science subject area to an acceptable level. Help us to eliminate the substantive shortcomings of this article and take part you in the discussion! ( ) Reason: Should oma -compatible, are partly the product simply needs a few more explanations. It should be noted in the revision and aggregation ( OLAP)! - Michileo 07:57, November 2, 2011 (UTC)

An aggregation in the computer science is either

  • A connection between data or objects
  • The process of creating metadata from data. The data is assigned to a certain group and will be made ​​general statements about the entire group.

For the sub-areas of computer science, there are still other meanings.

  • 2.1 Example: marriage versus building

Database

( SQL ) queries to a database management system often give back quantities of records. However, aggregated information can be determined by aggregate functions. A simple example is the calculation of an average age of a person table.

Example: average age

For an existing person table with the columns name and age, the average age to be calculated.

With SELECT name, age FROM people can all records are maintained. An aggregation ( the calculating the average age ) could be carried out subsequently by the programmed application logic.

The modified query SELECT AVG ( age ) FROM people (AVG stands for average German average ) are the average age back immediately (in this case 39 1/3).

" Is- part-of " relationship

Another use of the term aggregation is also found in the Entity -Relationship Model. Thus, several individual objects can be logically grouped together to form a complete object here. This is done with the " is- part-of " relationship.

OLAP

Similar use is in the area of ​​aggregation of OLAP systems. Here the same principle as the simple aggregate functions of SQL. However, it is there for the compression of entire data cube.

Object-oriented software development

In object-oriented programming, the aggregation is a special kind of association between objects. It describes a stronger relationship between objects than the general association - because when aggregating the associated objects are not equivalent, but an object " is part of" another object. In contrast to the composition ( which is also a " is a part of " the Association describes ) can exist, the partial object without the aggregate object. In UML, aggregation is symbolized by an empty diamond, the composition by the filled diamond.

Example: marriage versus building

Aggregation: A marriage consists of two spouses who continue to exist even after a divorce as an independent people.

Class marriage / / Example of an aggregation. { private:      Person & _partner1; / / Included part.      Person & _partner2; / / Included part.   public:      / / Initializing constructor.      Marriage ( Person & partner1, Person & partners2 )         : _partner1 ( Partner1 ) _partner2 ( partners2 )      { } }; Composition: In contrast, there is a building floors that persist not independent after its demolition.

Class buildings / / Example of a composition. { private:      std :: vector _stockwerke; / / Included parts.   public:      / / Initializing constructor.      Buildings (std :: size_t number of stock plants)         : _stockwerke ( Number of stock plants)      {          if ( number of stock plants <1)              throw std :: logic_error ( "The building must have at least one floor. ");      } }; routing

Aggregation is associated with routing protocols (eg BGP, OSPF or IS -IS) that multiple routes (partly engl. Prefixes called ) can be combined into a route without the target information contained is thereby altered content. Purpose of this measure is to minimize the number of routes to be managed and thus increase the efficiency of the routing protocol.

This technology requires the availability of Classless Inter- Domain Routing.

Aggregation can also be used to control the routing by adding a portion of an aggregated route through a more precise route ( engl. more specific) is also propagated. The precise route wins here for the specific target while the remaining area of ​​the aggregated route follows.

35043
de