Download presentation

Presentation is loading. Please wait.

Published byLucas Banwell Modified over 2 years ago

1
1 ©Amit Mitra & Amar Gupta RELATIONSHIPS Reading Assignment Supplementary module 5

2
2 ©Amit Mitra & Amar Gupta A RELATIONSHIP IS AN INTERACTION BETWEEN OBJECTS productcustomerretailer is sold to..buys thru... productcustomerretailer XX CARTESIAN PRODUCT product 1customer 1retailer 1 product 1customer 1retailer 2 product 1customer 2retailer 1 product 1customer 2retailer 2 product 2customer 1retailer 1 …... Relationship Class Relationship Instances Order of relationship = No. of classes involved Degree of relationship = No. Of object instances involved EXAMPLE OF A RELATIONSHIPS BETWEEN OBJECTS (3 rd order, 3 rd degree relationship)

3
3 ©Amit Mitra & Amar Gupta object object 1 object 2 Instance of relationship OBJECT CLASS A object 1 object 2 Instances of relationship inverse of relationship OBJECT CLASS B OBJECT CLASS A OBJECT CLASS B Instance of inverse of relationship object 4 object 1 Instances of relationship object 2 OBJECT CLASS B OBJECT CLASS A Instance of inverse of relationship BIJECTIVE RELATIONSHIP (1 to 1) INJECTIVE RELATIONSHIP (1 to many) SURJECTIVE RELATIONSHIP (many to 1) M A N Y to M A N Y object 3 Instance of inverse of relationship CAREFULL!!! (2 nd order, 2 nd degree relationship) Cardinality or Cardinality Ratios may be constrained –Usually cardinality ratios in both directions are specified

4
4 ©Amit Mitra & Amar Gupta PERSON ORGANIZATION many to manymany to many many to many resolution PERSON ORGANIZATION Person employed In Organization 0 to many Employ 0 to many may be employed by 0 or more [employ 0 or more] MANY-TO-MANY RESOLUTION

5
5 ©Amit Mitra & Amar Gupta object instance 1 OBJECT CLASS Object instance 2 Instance of reflexive relationship Instance of irreflexive relationship RECURSIVE RELATIONSHIPS (homogenous facts) Idempotent relationship must loop back to the same object instance (1 st order, 1 st degree relationship) (1 st order, 2 nd degree relationship) (1 st order relationships, degree unknown) Symmetrical: Inverse must be same as relationship –Eg: Person is relative of Person Asymmetrical: Inverse cannot be same as relationship –Eg: Person is parent of Person –Cartesian Product Antisymmetrical (for reflexive relationships only): Inverse cannot be same as relationship unless it loops back to the same object instance, in which case the relationship must be the same in both directions. –Eg: Arithmetic subtraction –Poymorphism of patterns of separation SYMMETRY Subtype of

6
6 ©Amit Mitra & Amar Gupta Instance Class OBJECT Instance Class OBJECT Class Instance OBJECT INFORMATION RELATIONSHIP RECURSIVE IRREFLEXIVE Polymorphisms of Relationships NON-RECURSIVE

7
7 ©Amit Mitra & Amar Gupta Recursive Relationship Subtype of Idempotent Relationship Subtype of Reflexive Relationship Asymmetrical Relationship Subtype of Antisymmetrical Relationship Symmetrical Subset of subset of Exhaustive partition Subtype of Symmetrical Relationship Eg: involve Locate relative of Eg: Part of parent of Polymorphisms of Relationships (2) Eg: Help in Person help Person Eg: Self Help Idempotent relationship will always be symmetrical Irreflexive Relationship Non-recursive Relationship Polymorphism of Polymorphism of Subtype of (inherited from recursive relationship) Eg: Civil War Eg: Distinct Parts of the nation at war with itself Where relationships begin

8
8 ©Amit Mitra & Amar Gupta HIGHER ORDER RELATIONSHIP is sold to..buys thru... productcustomer retailer possible ways in which minimum and maximum occurrence (cardinality) constraints may be defined for a three-way relationship m..n is sold to..buys thru... productcustomer retailer m..n Instances of this combination must be unique, otherwise it will not be an object class The symmetry of each combination must be considered The length of the tuple is determined by its degree Combinations may be recursive Cardinality of polymorphisms of a relationship cannot be less constrained than its parent (it may be more constrained) Cardinality = Nil is the same as the exclusion constraint

9
9 ©Amit Mitra & Amar Gupta Mutually inclusive and exclusive relationships Mutual Exclusion If one relationship exists, the other(s) cannot Mutual Inclusion If any one relationship exists, the other(s) also must Subsetting If one relationship exists, the other must, but not vice-versa A subtype must stay within the lawful state space of its parent

10
10 ©Amit Mitra & Amar Gupta Some additional information on cardinality constraints Instance level constraints –Eg: upper bound on cardinality ratio of Person lives in House –Each house might have a different capacity Upper bound constraints on cardinality of relationships creates the concept of Capacity Instance of is a subtype of the subtyping relationship constrained to a single member Instance level cardinality (or capacity) constraints cannot violate corresponding class level constraints The lower bound of the Cardinality (and enumeration) domain is nil –Cardinality ratios map to the domain of cardinality quotients (obviously!) Lower bound = nil = Optional relationship Lower bound = 1 = Mandatory relationship Often upper bound may be many –Many is a finite value: Open bound, delimited by infinity (example of a finite, bounded/delimited pattern, in which the delimiter is infinite) –These constraints are inherited by all counts Person Home Each person may own only 1 home own 0..1 Each person must own 1 home and no more 1..1 Each person must own 1, and may own more, homes 1..M 0..M [Each home may be owned by 1 or more persons]

11
11 ©Amit Mitra & Amar Gupta Relationships may be compositions of objects An object class may glue relationships end-to-end Together, two relationships imply the third Live in Explicitly asserting all three would denormalize and replicate information Structure also adds information to a collection: the entire composition considered together is a polymorphism of Live in Could have been a complex network of objects and relationships (remember the metamodel of Pattern) Which objects join which? In a network of associations how do we distinguish objects from relationships? The truth is that it does not matter; they are all objects and only the overall structure of association matters This is the essence of the pattern

12
12 ©Amit Mitra & Amar Gupta Polymorphisms of Relationships

13
13 ©Amit Mitra & Amar Gupta Polymorphisms of Relationships OBJECT RELATIONSHIP OBJECT PROCESS RECURSIVE

14
14 ©Amit Mitra & Amar Gupta Polymorphisms of Relationships

15
15 ©Amit Mitra & Amar Gupta RELATIONSHIP RECURSIVE Polymorphisms of Relationships OBJECT

16
16 ©Amit Mitra & Amar Gupta RELATIONSHIP RECURSIVE Polymorphisms of Relationships OBJECT

17
17 ©Amit Mitra & Amar Gupta Cardinality ratios of compositions 1.If any relationship in a chain of relationships in a composition is optional, the composite relationship will be optional 2.1 to 1 relationships in tandem result in a composite 1 to 1 relationship 3.A 1 to 1 relationship in tandem with a 1 to many relationship results in a composite 1 to many relationship 4.A Many to 1 relationship in tandem with a 1 to 1 relationship results in a composite many to 1 relationship 5.A 1 to 1 relationship in tandem with a many to 1 relationship results in a composite many to 1 relationship 6.A Many to 1 relationship in tandem with a Many to 1 relationship results in a composite many to 1 relationship 7.A 1 to Many relationship in tandem with a 1 to Many relationship may result in a composite many to many relationship 8.A Many to 1 relationship in tandem with a 1 to Many relationship results in a composite many to many relationship

18
18 ©Amit Mitra & Amar Gupta Mutability The Principle of Parsimony (of information) –Specify only what you must Basis for innovation!! –Liskovs principle A subtype may always substitute its parent in a rule, but not necessarily vice-versa (It must be possible to substitute any object instance of a subclass for any object instance of a superclass without affecting the semantics of a program written in terms of the superclass) MODIFICATION: It is possible to substitute any Pattern with its subclass without affecting the semantics of the pattern Apartment Living Space ApartmentHouse Subtype of object The concept of the essence of a pattern and the meaning of Essential emerge thus Eg: Is a check a paper document or a payment? What are the essential parts of a composition? What may we remove/change without changing the meaning of the composition? A car without its radio is still a car, but is a car without wheels still a car? What about a car without its chassis? What is the essence of the meaning of house: A house with a roof only, a roof and outside walls, or also inside walls, all of these? Larger scope and complexity require more abstraction The Universal Perspective must be abstract The goal of a process is its product A network like the Universal Perspective provides many paths to a goal Changing the essential meaning of a goal is a paradigm shift Apply the Principle of Parsimony with the Universal Perspective to help innovate or to automate innovation (subtypes of universal meanings may substitute each other as resources and products of processes

19
19 ©Amit Mitra & Amar Gupta TRANSITIVITY PERSONHOUSE WALL Owns 0 or more [owned by 0 or more] Consists of 1 or more [part of 0 or 1] TRANSITIVE Owns 0 or more [owned by 0 or more] (automatically implied) Transitive relationship Transitivity, or the lack of it has several flavors

20
20 ©Amit Mitra & Amar Gupta 2 nd Degree intransitivity Transitivity Transitive: Together, a set of relationships imply another One relationship must be eliminated to normalize knowledge The degree of transitivity is the max. number of relationships in a transitive chain If the set of relationships is a set of processes, the last process should be eliminated Live in Transitive triad Intransitive: A relationship is barred if a set of relationships exists Atransitive:No inclusion or exclusion constraints between relationships Is friend of transitive, atransitive or intransitive? Person Parent of Person Parent of DISSALLOWED (Degree can be infinite) (Eg: The transitivity of Ancestor of)

21
21 ©Amit Mitra & Amar Gupta COMPOSITION x Subtype of Transitive Composition Intransitive Composition Subtype of Tansitivity (2) Transitivity is about compositions A Transitive relationship may be symmetrical or not –Eg: Relative of (symmetrical) vs. Ancestor of (asymmetrical) An intransitive relationship has more information than a transitive relationship –It will always be asymmetrical Eg: Parent of May be symmetrical (eg: relative of) Or Asymmetrical (eg: ancestor of) May only be asymmetrical (eg: parent of) Increasinf information

22
22 ©Amit Mitra & Amar Gupta Quantitative (arithmetic) Rule Expression Nominal Rule Expression Ordinal Rule Expression Subtype of Inherit Classification information; Add ranking information Inherit classification and ranking information; Add quantitative information Quantitative (arithmetic) Rule Expression Nominal Rule Expression Ordinal Rule Expression Subtype of Ranking operations Quantitative operations (includes arithmetic operations, ranges, inequalities, equalities formulae etc) Boolean operations (including existence constraints like cardinality constraints) OCCURRENCE AND EXISTENCE TO ARITHMETIC AND EQUATIONS

23
23 ©Amit Mitra & Amar Gupta PRODUCT SALE PRODUCT constituent of relationship CUSTOMER constituent of relationship = Relationship PLACE constituent of relationship 3 rd ORDER RELATIONSHIP sell Sell to Sell at STATE SPACE OF A RELATIONSHIP

24
24 ©Amit Mitra & Amar Gupta AN INSTANCE OF A 3 RD ORDER MANIFOLD SHOWN IN THREE SPACE products places customers a particular product sold to a particular customer at a particular place An instance of an ordinary binary relationship would be a point in two-space Each item, product, place and customer may normalize different properties (like product feature, geographical footprint and customer age respectively) –Each axis may unfold into a state space, each axis of which could in turn summarize a state space and so on

25
25 ©Amit Mitra & Amar Gupta products places customers a particular product sold to a particular customer at a particular place A category is a region with various points inside it Ovelapping categories Mutually Exclusive, or Non- overlapping categories Two dimensional region CATEGORIES IN THREE SPACE

26
26 ©Amit Mitra & Amar Gupta BOREL SET Sale price products places = INSTANCES OF BOREL SETS ANOTHER INSTANCE OF A BOREL SET A BOREL SET is the set of all possible regions in that space –In nominal state space it will be the set of all possible subsets –If we consider the All value, the Borel object will include all intervals in state spaces of supertypes and subtypes

27
27 ©Amit Mitra & Amar Gupta EXAMPLES OF 3 RD ORDER MARKET SEGMENT BOREL SET IN THREE SPACE products places customers a particular product sold to a particular customer at a particular place A category is a region with various points inside it Ovelapping categories Mutually Exclusive, or Non- overlapping categories category id productplacecustomer seg 1ALLNYCGE seg 1ALLNYCGM seg 2ALLNYCGM seg 2ALLNYCToyota More categories The origin may represent shared values like All For spaces composed of axes that have a Nil value, such as ratio scaled spaces, the origin might represent the shared Nil value

28
28 ©Amit Mitra & Amar Gupta BOREL OBJECT EXAMPLE Note: At least one relationship, (or combination of relationships), with constituent objects -- product,customer,sales channel -- must exist at each moment in time PRODUCT SALE PRODUCT constituent of relationship CUSTOMER constituent of relationship SALES CHANNEL constituent of relationship MARKET SEGMENT many to manymany to many PRODUCT SALE MARKET SEGMENT PRODUCT SALE IN MARKET SEGMENT 1 to many 0 to many many to many resolution = Relationship = Borel Object = Resolution Object

29
29 ©Amit Mitra & Amar Gupta (At least 1 relationship to a constituent entity must exist at any given time) RELATIONSHIP (ASSOCIATIVE OBJECT) OBJECT constituent of Borel Object OBJECT constituent of manifold OBJECT constituent of manifold BOREL OBJECT OF RELATIONSHIP many to many RELATIONSHIP BOREL OBJECT RESOLUTION OBJECT 1 to many 0 to many = Relationship Degree of combination = 1 or more Eg.: Product Transfer/usage agreement Eg.: Market segment resolution object name IN BOREL OBJECT RULES Every relationship implies a corresponding Borel Object

30
30 ©Amit Mitra & Amar Gupta Quantitative (arithmetic) Rule Expression Nominal Rule Expression Ordinal Rule Expression Subtype of Ranking operations Quantitative operations (includes arithmetic operations) Boolean operations (including existence constraints)

31
31 ©Amit Mitra & Amar Gupta EXCLUSION CONSTRAINT ON RELATIONSHIPS INSURANCE COVERAGE ASSET PERSON cover MUTUALLY EXCLUSIVE RELATIONSHIPS X

32
32 ©Amit Mitra & Amar Gupta EQUALITY CONSTRAINT ON RELATIONSHIPS PERSON CAR INSURANCE own MUTUALLY INCLUSIVE RELATIONSHIPS

33
33 ©Amit Mitra & Amar Gupta SUBSETTING CONSTRAINT ON RELATIONSHIPS PERSON CAR WHEEL owns SUBSET OF owns ONE RELATIONSHIP IMPLIES THE OTHER, BUT NOT VICE-VERSA

34
34 ©Amit Mitra & Amar Gupta Cardinality = 0 or more bind.. Insurance Agreement Owner Insurer Own.. Person Wheel Car Cardinality Cannot exceed cover.. Degree = 1 Person Asset Insurance Coverage cover.. Insurance Coverage Person Asset m..n

35
35 ©Amit Mitra & Amar Gupta Cardinality = 0 or more own.. Person car Car Insurance Own.. Person Wheel Car Cardinality Cannot exceed cover.. Degree = 1 Person Asset Insurance Coverage Degree = 2

36
36 ©Amit Mitra & Amar Gupta cover Person Asset Degree = 1 cover Insurance Coverage bind Cardinality = 0 or more bind Insurance Agreement Owner Insurer owns Cardinality cannot exceed cardinality of Person owns Wheel owns Person Car Wheel Degree = 2

37
37 ©Amit Mitra & Amar Gupta cover Person Asset Degree = 1 cover Insurance Coverage own Cardinality = 0 or more own Person Car Insurance owns Cardinality cannot exceed cardinality of Person owns Wheel owns Person Car Wheel Degree = 2

38
38 ©Amit Mitra & Amar Gupta

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google