data explorer dex
play

Data Explorer (DEX) RWTH Aachen University Page 2 DEX is a - PDF document

Farbe! CD 1 Generative Class role Type attribute Software interface Interface Engineering Class * Type method() composition 2. Generating Data Explorers qualifier qualified_association Prof. Dr. Bernhard Rumpe Software


  1. Farbe! CD 1 Generative Class role Type attribute Software «interface» Interface Engineering Class * Type method() composition 2. Generating Data Explorers qualifier qualified_association Prof. Dr. Bernhard Rumpe Software Engineering RWTH Aachen University http://www.se-rwth.de/ Prof. Dr. B. Rumpe Software Engineering Data Explorer (DEX) RWTH Aachen University Page 2  DEX is a generator for (parts of) business applications  Input: Class Diagram, (OCL constraints)  Generated result • Running application DEX generator UML/P CD textual class diagram Java Swing Application  We use DEX to study • how a generator works • how to adapt and extend it’s components

  2. Farbe! CD 1 Generative Class role Type attribute Software «interface» Interface Engineering Class * Type method() composition 2. Generating Data Explorers qualifier 2.1. Class Diagrams as Input qualified_association Prof. Dr. Bernhard Rumpe Software Engineering RWTH Aachen University http://www.se-rwth.de/ Prof. Dr. B. Rumpe Software Engineering Class Diagrams RWTH Aachen University Page 4  We assume that you are familiar with CDs, here a short overview (and excerpt of our case study “Social Network”): this is a class diagram CD 1 Relationship * invited «abstract» Profile boolean pending 1 initiated * Date requested String profileName Date accepted /int numberOfPosts /int friends 1 «enum» RelationType * * Person Group FRIEND member FAMILY Date lastVisit boolean isOpen COLLEAGUE String firstName Date created FOLLOWER String secondName String purpose OTHER Date dateOfBirth /int headcount profileName organizer organized * 1

  3. Prof. Dr. B. Rumpe Software Engineering Social Network – The Full Domain Model RWTH Aachen University Page 5 CD SocNet 1 1 Relationship invited sent * * «abstract» Profile {ordered} «interface» boolean pending * 1 * Post * initiated received Date requested String profileName Date accepted {ordered} /int numberOfPosts /int friends 1 * «enum» InstantMessage 0..1 RelationType Date timestamp * * replyTo Person Group FRIEND member String content FAMILY Date lastVisit boolean isOpen COLLEAGUE String firstName Date created FOLLOWER String secondName String purpose OTHER Date dateOfBirth /int members PhotoMessage int zip profileName String city organizer organized String country * picture 1.. * 1 tagged 1 Photo 1 * * Tag double height boolean confirmed double width Prof. Dr. B. Rumpe Software Engineering Concepts we know in CD’s RWTH Aachen University Page 6  Classes • Interfaces, abstract classes, enumerations  Attributes • Name + Type + Visibility • derived attributes  Associations • Name, role names, cardinalities  Composition  Qualified associations • Qualifier  {ordered} association  Stereotypes like <<singleton>>

  4. Prof. Dr. B. Rumpe Software Engineering We use a textual notation for CDs RWTH Aachen University Page 7  Text is easier to process  Text is easier to define  A class diagram thus becomes a text-file of this form and is stored in SocNet.cd CD classdiagram SocNet { class ... class ... association ... }  We next define the textual input … Prof. Dr. B. Rumpe Software Engineering Textual Form for Classes RWTH Aachen University Page 8  A class looks pretty similar to Java code, but no methods: CD SocNet classdiagram SocNet { «interface» Post interface Post; class InstantMessage implements Post { InstantMessage Date timestamp; Date timestamp String content String content; } }

  5. Prof. Dr. B. Rumpe Software Engineering Textual Form for Enumerations RWTH Aachen University Page 9  An enumeration in a CD looks like this CD SocNet (and can be used as type elsewhere in the class diagram): Relationship class Relationship { boolean pending Date requested boolean pending; Date accepted Date requested; Date accepted; 1 } «enum» RelationType FRIEND enum RelationType { FAMILY COLLEAGUE FRIEND, FAMILY, FOLLOWER, COLLEAGUE, OTHER; FOLLOWER } OTHER association Relationship -> RelationType [1]; Prof. Dr. B. Rumpe Software Engineering Textual Form for Associations -1 RWTH Aachen University Page 10  An association in the CD: CD SocNet * * member Group Person association member [*] Person <-> Group [*] navigation direction, assoc. name class name multiplicity, e.g. [*], [1], [2..6], [0..1]  Navigation directions: ->, <-, <-> and –  Assoc. name, multiplicities are optional

  6. Prof. Dr. B. Rumpe Software Engineering Textual Form for Associations -2 RWTH Aachen University Page 11  An association in the CD: CD SocNet Person Group profileName * organizer organized * association [*] Person (organizer) <-> (organized) [profileName] Group [*]; role name qualifier  Role names for navigation  Qualifier is an attribute of the opposite class Prof. Dr. B. Rumpe Software Engineering Lets define classes: RWTH Aachen University Page 12 CD SocNet «abstract» Profile String profileName /int numberOfPosts /int friends abstract class Profile { String profileName; /int numberOfPosts; Group /int friends; boolean isOpen } Date created String purpose class Group extends Profile /int headcount { boolean isOpen; Date created; String purpose; /int headcount; }

  7. Prof. Dr. B. Rumpe Software Engineering Lets define more: RWTH Aachen University Page 13 CD SocNet «interface» Post * InstantMessage 0..1 interface Post; Date timestamp replyTo String content class InstantMessage implements Post { Date timestamp; String content; PhotoMessage } association [*] InstantMessage <-> (replyTo) InstantMessage [0..1]; class PhotoMessage extends InstantMessage; Prof. Dr. B. Rumpe Appendix Software Engineering Grammar of UML/P CD lite language RWTH Aachen University Page 14 CDDefinition = MG "classdiagram" Name "{“ (CDClass | CDInterface | CDEnum | CDAssociation)* "}" This is the compact, readable CDClass = grammar for the concrete "abstract"? "class" Name syntax. For the full language ("extends" ReferenceType ("," ReferenceType)*)? ("implements" ReferenceType ("," ReferenceType)*)? spec please see: (CDClassBody | ";") http://www.monticore.de/dex CDClassBody = "{" CDAttribute* "}" CDAttribute = "/"? Type Name ("=" Value)? ";" CDInterface = "interface" Name ("extends" ReferenceType ("," ReferenceType)*)? ";" CDEnum = "enum" Name (CDEnumBody* | ";") CDEnumBody = "{" (CDEnumConstant ("," CDEnumConstant)* ";")? "}" CDEnumConstant = Name CDQualifier = "[" Name "]" RoleName = "(" Name ")" CDAssociation = "association" "/"? Name? Cardinality? QualifiedName CDQualifier? RoleName? ( "->" | "<-" | "<->" | "--" ) RoleName? CDQualifier? QualifiedName Cardinality? "<<ordered>>"? ";" Cardinality = "[" ("*" | Int | Int ".." Int | Int ".." "*") "]";

  8. Prof. Dr. B. Rumpe Appendix Software Engineering The full CD SocNet in textual form -1 RWTH Aachen University Page 15 package dex; CD SocNet import java.util.*; classdiagram SocNet { abstract class Profile { String profileName; /int numberOfPosts; Excerpt from SocNet.cd /int friends; } class Person extends Profile { Date lastVisit; String firstName; String secondName; Date dateOfBirth; int zip; String city; String country; } class Group extends Profile { boolean isOpen; Date created; String purpose; /int headcount; } association member [*] Person <-> Group [*]; association [1] Person (organizer) <-> (organized) [profileName] Group [*]; Prof. Dr. B. Rumpe Appendix Software Engineering The full CD SocNet in textual form -2 RWTH Aachen University Page 16 class Relationship { CD SocNet boolean pending; Date requested; Date accepted; } association invited [*] Relationship <-> Profile [1]; association initiated [*] Relationship <-> Profile [1]; enum RelationType { FRIEND, FAMILY, FOLLOWER, COLLEAGUE, OTHER; } association Relationship -> RelationType [1]; interface Post; association received [*] Profile <-> Post [*] <<ordered>>; association sent [1] Profile <-> Post [*] <<ordered>>; class InstantMessage implements Post { Date timestamp; String content; } association [*] InstantMessage <-> (replyTo) InstantMessage [0..1]; class PhotoMessage extends InstantMessage; association [1..*] Photo (picture) <-> PhotoMessage; class Photo { double height; double width; } class Tag { boolean confirmed; } association [1] Person (tagged) <-> Tag [*]; association [*] Tag <-> Photo [1]; }

Recommend


More recommend