1 / 18

Conceptual Modelling

Conceptual Modelling. Entity Relationship Model. Overview. Entities, Attributes and Relationship modelling Generating a Relational Database for an EAR model Tutorial - Using the QSEE case tool. Abstraction Layers. WHAT. Conceptual What data is held An Image and its meta-data

greta
Download Presentation

Conceptual Modelling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Conceptual Modelling Entity Relationship Model

  2. Overview • Entities, Attributes and Relationship modelling • Generating a Relational Database for an EAR model • Tutorial - Using the QSEE case tool

  3. Abstraction Layers WHAT • Conceptual • What data is held • An Image and its meta-data • Entity-Relationship model (ERM) • Logical • How data is organised in storage • Block and Directory structure • Tables, keys • Physical • How data is stored in bits • JPEG as a stream of bytes • A Database as files and records stored in a DBMS-specific format Realisation (Refinement Reification) (Engineering, Model-Driven development Abstraction (Reverse Engineering) HOW

  4. ER Model • This modelling language allows a very small vocabulary: Just as English has nouns, verbs, adjectives, pronouns.. • ER models have only 3 core concepts • Attribute – a simple, atomic data item like a date, a name, a number [also called Property or Field] • Entity – a group of attributes which are all related to the same thing [also called Entity Type or Class] • Relationship – a relationship between Entities.

  5. Entities and Instances Data Instances (entity instances, objects) Employee SMITH Employee ALLEN Schema isA isA Entity (entity type, class) Employee

  6. MMS application • A simple web application which allows an account holder to send a photo from a mobile phone to a web site to be added to a photo gallery • Server Technology • Data storage in MySQL relational database • Scripting language : PHP

  7. MMS Photo Gallery Documentation mmsmail@cems.uwe.ac.uk MMS mailbox Originating phoneno mime2db.php MySql database mimedecode.php mms1 php scripts index.php getpage.php getimage.php

  8. MMS Photo : EAR diagram Entity Each Photo created by exactly one Member Relationship Attribute Or none Each Member has created many Photos Primary key Data Type Diagram generated by QSEE

  9. Other conceptual models • ERM is not the only conceptual model in use • Object-role model (ORM) drop the distinction between attributes and relationships – its all relationships. • Single level models (RDF) drop the distinction between type and instance.

  10. Case Tool - QSEE • is a free download for individual use • is available in the lab (older version ) • enables a wide range of diagram types to be created • UML • Data flow diagrams … • Entity-relationship diagram • With generation of SQL for creating a database (with some fixes  - use Perl script to clean up)

  11. Entity (type) • Typically represents a type of thing –person, department, photo with properties of interest • Similar to a Class in Object-Orientation (but no methods) • Has a name • Name becomes the name of the table in a database • I prefer a singular noun – Employee, Department. The table will contain a varying number of entity instances but the Entity Type is singular • Has attributes or properties (which might become fields or columns in a database) • Entity instances are related (linked) to other entity instances – relationships • Has an Annotation (in QSEE) • Text to describe the scope of this type (what things can be one of these), the meaning and usage, a typical example.

  12. Attribute • Name • Must be unique within the Entity • Avoid SQL reserved words • Type (data type) • SQL provides a set of available data types – essential ones are: • integer – a whole number • numeric – number with decimal part • character – fixed length string • varchar – variable length string • date – hold dates like 2005-10-14 • blob – a very large field – such as a JPEG image • Primary Key • An attribute(or several) which uniquely identify each instance of the entity within the set of all instances.

  13. Relationships in QSEE • Name • Names the relationship • There can be multiple relationships between the same entity types e.g, • Employee –Department • Works in • Is manager of • Has worked in • Must never work in • Relationship ends (roles) can be named too – I prefer to use this than relationship names which need a direction • Cardinality • from source (start) to destination (end) • Optional • Identifier • For 1-M, does the source (partly) identify the destination • Annotation • Text describing the meaning of this relationship

  14. Relationship CARDINALITY M1 M2 M4 P1 P4 P5 P3 P7 One-one One-many Member Photo Many-many 1..n 1..n

  15. It is hard to get this notation the right way round. • Always read it both ways • Every X is related to how many Y’s? • Every Y is related to how many X’s?

  16. Relationship OPTIONALITY M1 M3 M2 P1 P4 P5 P7 P3 P7 One-many Member Photo

  17. QSEE

  18. Class Exercise - KML • A Folder has a name and contains zero, one or more PlaceMarks and some Styles • A Placemark has attributes of : • A name • A description • A position defined by its longitude, latitude and Altitude, each represented by a signed decimal number • A Style defines the appearance of a placemark – the symbol to show, the size, the foreground and background colour. • Each Placemark has a Style • Draw an ERM for this simplified description of a KML Folder.

More Related