Generic Modeling

Embed Size (px)

Citation preview

  • 8/12/2019 Generic Modeling

    1/15

    1

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Generic Modeling

  • 8/12/2019 Generic Modeling

    2/15

    2

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    What Will I Learn?ObjectivesIn this lesson, you will learn to:

    Define generic modeling Evaluate and describe the advantages

    and disadvantages of generic modeling Construct a generic version of a more

    specific data model

  • 8/12/2019 Generic Modeling

    3/15

    3

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Why Learn It?

    Purpose

    Generic models can reduce the number ofentities in a diagram and provide a lot offlexibility in unstable situations, where thebusiness requirements change often.

    A business that needs to frequently addentities and/or attributes could benefit fromgeneric modeling. One example would bea pawnshop that buys and sells different

    types of items all the time. It would bedifficult to predict the number of item typesand the different attributes each typewould have.

    sdm_s11_l03_a01

  • 8/12/2019 Generic Modeling

    4/15

    4

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show Me

    GenericModelingGenericmodeling looksat the same

    context fromanother, moredistantperspective.From a distance,

    many things lookthe same.

    MANUFACTURER

    # name

    ARTICLE TYPE# name

    ARTICLE

    # id* length* material waistband type bodice cut hem circumference neck size sleeve length

    MANUFACTURER

    # name

    SHIRT* id* length* material* neck size

    * sleeve length

    SKIRT# id

    * length* material* waistband type* hem circum

    DRESS# id* length* material* bodice style

    PANTS# id* length* material waistband type

    produced

    theproducer

    produced classified

    GENERIC MODEL

    theproducer

  • 8/12/2019 Generic Modeling

    5/15

    5

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show MeChoosing a Generic ModelSuppose you are to make a model for aclothing store. The business typically sellsmany different articles: shoes, shirts, dresses,pants, and so on. For each type of clothing

    article, there are different attributes. You canmodel every type as an entity. Or you couldcreate a more generic model that uses oneentity, ARTICLE, with or without subtypes.

    However, this model would be fine only ifthere were no (or possibly very few) newinstances of ARTICLE TYPE during the lifecycle of the system.

  • 8/12/2019 Generic Modeling

    6/15

    6

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show Me

    Recycling of Attributes Another generic modelinvolves recyclingattributes.

    Using this structure, hereare some examples ofinstances of ARTICLETYPE:

    the classificationfor

    classifiedby

    the producer of

    producedby

    ARTICLE TYPE# name* definition of Prop. 1* definition of Prop. 2* definition of Prop. 3o definition of Prop. 4

    MANUFACTURER# name

    VALUE* value of Prop. 1* value of Prop. 2* value of Prop. 3o value of Prop. 4o value of Prop. 5

    o value of Prop. 6o value of Prop. 7

  • 8/12/2019 Generic Modeling

    7/157

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show MeRecycling of Attributes (continued)

    Name Def. ofProp. 1

    Def. of Prop2

    Def. ofProp 3

    Def ofProp 4

    Def ofProp 5

    SHIRT id Length Material Neck Size SleeveLength

    SKIRT Id Length Material WaistbandType

    HemCircum.

    DRESS id Length Material BodiceStyle

    PANT id Length Material WaistbandType

    You can also store information about the data types of eachproperty in the definition attributes (example: property 2 for allarticles (length) has a data type of number, property 4 ofDRESS (bodice style) is stored as text).

  • 8/12/2019 Generic Modeling

    8/158

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show MeExampleThese would be the examples of corresponding instances of

    ARTICLE.

    the classificationfor

    classifiedby

    the producer of

    producedby

    ARTICLE TYPE# name* definition of Prop. 1* definition of Prop. 2* definition of Prop. 3o definition of Prop. 4

    MANUFACTURER

    # name

    VALUE

    * value of Prop. 1* value of Prop. 2* value of Prop. 3o value of Prop. 4o value of Prop. 5o value of Prop. 6o value of Prop. 7

  • 8/12/2019 Generic Modeling

    9/159

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show MeGeneric ValuesUsing this method, you can add new types of articles fairlyeasily, provided that the number of attributes does not exceedthe maximum that was originally defined.

    ARTICLETYPE

    Name

    Def. ofProp. 1

    Def. ofProp 2

    Def. ofProp 3

    Def ofProp 4

    Def ofProp 5

    SHIRT DNM105 40 Denim 16 33

    SKIRT LIN200 22 Linen Elastic 60

    DRESS SHF119 60 Jersey Empire

    PANT CHN407 33 Khaki Flat Front

  • 8/12/2019 Generic Modeling

    10/1510

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show MeAttributes Modeled as

    Property Instance

    This model takes a thirdapproach. Every value for aproperty of an ARTICLE isstored separately. This modelgives a lot of freedom to definenew articles and propertiesduring the life cycle of thesystem.

    Using this structure, here aresome examples of instances ofeach entity:

    ARTICLE PROPERTY VALUE* value

    ARTICLE# id

    PROPERTY# number

    MANUFACTURER* name

    ARTICLE TYPE# name

    theproducer

    of

    producedby

    theclassification

    for

    classifiedby

    theowner

    of

    ownedby

    theholder

    of

    heldby

    containedin

    the

    containerfor

  • 8/12/2019 Generic Modeling

    11/1511

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show Me

    Name

    SKIRT

    SHIRT

    DRESSPANT

    ARTICLE TYPEArticleType Name

    No. Desc.

    SHIRT 1 Length

    SHIRT 2 Material

    SHIRT 3 Neck size

    SKIRT 1 Length

    PROPERTY

    Article TypeName

    Id

    SHIRT DNM105

    SKIRT LIN200

    DRESS SHF119

    PANTS CHN407

    ARTICLE

    Article ID Article Type Name PROPERTY Number Value

    DNM105 SHIRT 1 40

    DNM105 SHIRT 2 DenimDNM105 SHIRT 3 16

    LIN200 SKIRT 1 22

    ARTICLE PROPERTY VALUE

    Attributes Modeled as Property Instance (continued)

  • 8/12/2019 Generic Modeling

    12/1512

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show MeGeneric Model Benefits

    The benefits of a generic model include:

    (1) Flexible -- can prevent the need tochange data structures in the future

    (2) Can reduce the number of entitiesdramatically

    Cost: Increased complexity in both the datamodel and application programs

    sdm_s11_l03_a02

  • 8/12/2019 Generic Modeling

    13/1513

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Tell Me / Show MeTerminologyKey terms used in this lesson include:

    GenericPerspective

  • 8/12/2019 Generic Modeling

    14/1514

    Generic Modeling

    Copyright 2011, Oracle. All rights reserved.

    Objectives SummarizedIn this lesson, you have learned to: Define generic modeling Evaluate and describe the advantages and

    disadvantages of generic modeling Construct a generic version of a more specific data

    model

    Summary

  • 8/12/2019 Generic Modeling

    15/1515

    Generic Modeling

    C i h 2011 O l All i h d

    Practice GuideThe link for the lesson practice guide can be found inthe course resources in Section 0.

    Summary