5. What kind of relationship do we model with interfaces? Explain your answer with an example. 6. What are some of the key differences between interfaces and inheritance? List three.
5 and 6
What kind of relationship do we model with interfaces?
Answer:
Dimensional Modeling :
Comparing Approaches:
ER modeling sometimes referred to as normalized modeling, is the standard transactional system (also called operational or online transactional processing (OLTP) systems). Dimensional modeling is the best practice for BI and OLAP systems. The reason for this stems from how the two systems process and manipulate data.
The data in operational systems is being constantly updated. The main job of these workhorses is transaction throughput. They have to maintain and update a large number of records, so they have to be able to handle high amounts of consistent throughput with large volumes.
Compare that with the BI and reporting systems, which are generally not updating data. Rather, they are copying, extracting, transforming, and loading from operational systems. They are not doing real-time updates like operational systems. The focus is not on transactional throughput once the data is loaded. The focus is on query performance and gathering and aggregating large sets of data. That’s a critical operation. Transactional systems update a small number of data records quite often, whereas BI systems gather and aggregate large sets of data records, but not so often—sometimes over large spans of time. The data from the BI system then get used for reports. See Table 9.1 for a summary of the differences.
Operational Systems | BI and Analytics |
---|---|
Normalized models are standard for OLTP | Dimensional models are standard for BI and OLAP |
Highly volatile | Generally not updated |
Transaction throughput (updating and maintaining numerous records) is critical | Query performance (gathering and aggregating large sets of records) is critical |
Characteristics supporting the use of normalized models: | Characteristics supporting the use of dimensional models: |
Minimal redundancy (normalization) | Increased redundancy (denormalization) |
Limited index use | Increased index use |
Efficient use of storage space | Increased storage space |
Eliminate inconsistent data | Consolidate inconsistent data |
Few maintenance concerns | Increased maintenance issues |
The operating system and its accompanying normalized models have minimal redundancy to support the high transaction throughput. Its limited indexes and efficient use of storage space eliminate the need for consistent data, also contributing to the fast transaction throughput. The system is able to update and maintain records instantaneously.
On the other hand, in BI reporting, there is a lot of redundancy. After all, the warehouse and data marts and whatever else you store on the reporting side are all copies of data that originally was in the operational systems. The BI system depends heavily on indexes and partitioning because it needs much more storage space for reporting, whereas the operating system only needs internal consistency, it doesn’t have to be consistent with other systems’ data. BI needs to have consistent data consolidated from multiple operating systems, so the inconsistency might not be just in the individual system, but across the various systems. Many of the dimensional constructs are set up to support consistent information.
Because the operating system has no redundancy and limited index usage, there are fewer maintenance concerns. A BI system, however, has more maintenance issues than an operating system because it’s storing data over a long period of history, and data does not age well.
Conceptual Modeling :
ENTITY-RELATIONSHIP DIAGRAMS :
The first conceptual modeling method, Entity-Relationship Modeling, was invented by Peter Chen in the 1970s [Chen1976]. ERM is so simple that everybody can understand it: For ERM the world consists of entities. Entities may have attributes, and we can have relationships between entities. Entities of the same type form an entity set, and relationships of the same type form a relationship set. All this is defined in a rather informal way.
As an example of the Entity-Relationship method, we reverse engineer the document schemata given in Chapter 1 and present the conceptual model in the original notation of 1976. Figure 2.2 shows the results. The rectangles represent entity sets. Entity attributes are represented by ellipsoids. Double-outlined rectangles represent weak entities (entities that are subordinate to other entities). The triangle represents a generalization (product is a generalization of book and CD). Relationships are represented by rhombs. An arrow restricts the cardinality to 1; otherwise, the cardinality is not restricted. In our example, one customer can order several products, and each product is attributed with an amount.
Entity-Relationship Model :
The Entity-Relationship (ER) modeling approach views a business domain in terms of entities that have attributes and participate in relationships. For example, the fact that an employee was born on a date is modeled by a birthdate attribute of the Employee entity type, whereas the fact that an employee works for a department is modeled as a relationship between them. This world view is quite intuitive, and despite the recent rise of UML for modeling object-oriented applications, ER is still the most popular data modeling approach for database applications.
In Chapter 1, we argued that ORM is better than ER for conceptual analysis. However, ER is widely used, and its diagrams are good for compact summaries, so you should become familiar with at least some of the mainstream ER notations. This is the main purpose of this chapter. A second purpose is to have a closer look at how ORM compares to ER. To save some explanation, we assume that you have already studied the basics of ORM in earlier chapters so that we can examine ER from an ORM perspective.
The ER approach was originally proposed by Dr. Peter Chen in the very first issue of an influential journal (Chen 1976). Figure 8.1 is based on examples from this journal paper. Chen's original notation uses rectangles for entity types and diamonds for relationships (binary or longer). Attributes may be defined, but are excluded from the ER diagram. As in ORM, roles are defined as parts played in relationships. Role names may optionally be shown at relationship ends (e.g., Employee plays the worker role in the Proj-Work relationship).
Step by step
Solved in 2 steps