uml modelling for web application development. representing designs in uml the unified modeling...

23
UML Modelling for Web Application Development

Post on 21-Dec-2015

237 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

UML Modelling for Web Application Development

Page 2: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Representing Designs in UML

The Unified Modeling Language (UML) is a set of diagram types

Used to represent software designs

Most commonly used diagram types are:

– Structure diagrams• A static view of objects and their relationships• Inheritance, composition, dependencies

– Sequence diagrams• A view of the dynamic behavior of software• Ordering of calls among class instances & their methods

Page 3: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

UML and PHP

• UML is designed to represent object oriented languages

• PHP can be both object-oriented and page-oriented, with procedural code embedded in a page

• Requires some tweaks to UML to represent this correctly

Page 4: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

UML Structure Diagrams

• Classes: • Visibility of variables and methods is indicated by putting + (visible) or – (private) before the variable or class name.

• Static variables are indicated by underlining them

• Can optionally indicate the signature (parameters) for methods, and the return type of a function.

Page 5: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Representing PHP Pages

PHP Page:

Basic Idea: represent a page using the same graphic element as classes (a rectangle)

To indicate this is a page, and not a class, put “[[“ and “]]” around page name (e.g., [[index.php]]).

Variables represents those variablesdefined outside of functions on a page (page global variables).

Visibility of variables and functions isalways public.

Functions represent those functions defined on the page. Classes defined on the page are represented as separate classes in the diagram.

Page 6: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Relationships

Inheritance– A open arrow pointing to parent class

– PHP pages cannot participate in inheritance

relationships

Page 7: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Relationships (cont’d)

Association– In general, a semantically meaningful link between

two classes

– Represented with a line, with a label on top, with a

closed arrow indicating the directionality of the

relationship

– For PHP pages, can use this to indicate “include”

relationships among pages• Note: use only for PHP pages, not for PHP classes

Page 8: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Familiar Example

How many:

•HTML pages

•PHP Server Pages

•Style Sheets

•Database Tables

Page 9: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

<<Persistent>><<Persistent>>GuestBook EntryGuestBook Entry

EntryIDEntryIDFirstNameLastNameDateComment

<<server page>><<server page>>RetrieveEntriesRetrieveEntries

EntryIDEntryIDFirstNameLastNameDateComment

<<client page>><<client page>>GuestBookEntriesGuestBookEntries

<<client page>><<client page>>GuestBookEntryGuestBookEntry

EntryIDEntryIDFirstNameLastNameDateComment

<<Builds>>

<<Drawn From>>

Page 10: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

<<Persistent>><<Persistent>>GuestBook EntryGuestBook Entry

EntryIDEntryIDFirstNameLastNameDateComment

<<Form>><<Form>>NewEntryNewEntry

FirstNameLastNameDateComment

<<ServerPage>><<ServerPage>>GuestBook EntryGuestBook Entry

FirstNameLastNameDateComment

<<Submit>> <<Inserts>>

Page 11: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

<<Persistent>><<Persistent>>RegisteredUsersRegisteredUsers

UserIDUserIDFirstNameLastNameUserNamePassword

<<Form>><<Form>>NewUserNewUser

FirstNameLastNameUserNamePassword

<<ServerPage>><<ServerPage>>RegisterNewUserRegisterNewUser

FirstNameLastNameUserNamePassword

<<Submit>> <<Inserts>>

Page 12: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Version Three

How many:

•HTML pages, PHP Server Pages

•Style Sheets, Database Tables

•Cookies, session variables

Page 13: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

<<Form>><<Form>>SearchbyTopicSearchbyTopic

Topic

<<ServerPage>><<ServerPage>>TopicSearchTopicSearch

Topic<<Submit>>

<<Searches>>

<<Persistent>><<Persistent>>GuestBook EntryGuestBook Entry

EntryIDEntryIDFirstNameLastNameDateComment

<<Persistent>><<Persistent>>TopicTopic

1

n

TopicID

TopicIDTopicIDTitle

Page 14: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

<<Form>><<Form>>SearchbyUserSearchbyUser

RegisteredUser

<<ServerPage>><<ServerPage>>TopicSearchTopicSearch

RegisteredUser<<Submit>>

<<Searches>>

<<Persistent>><<Persistent>>GuestBook EntryGuestBook Entry

EntryIDEntryIDFirstNameLastNameDateComment

<<Persistent>><<Persistent>>RegisteredUserRegisteredUser

1

n

UserID

FirstNameLastNameUserNamePassword

Page 15: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Entity Model for Version Three

Page 16: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

Looking at the World through UML Specs

Page 17: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent
Page 18: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent
Page 19: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent
Page 20: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent
Page 21: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent
Page 22: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent
Page 23: UML Modelling for Web Application Development. Representing Designs in UML The Unified Modeling Language (UML) is a set of diagram types Used to represent

“Get Staff Contact Details”

Action

1. Provide Staff Surname and Initials via a form

2. Post this information to a server program that will:

• retrieve data from the staff table in the database

• Build a web page to display the matching names

3. Select a name from this list and follow hyperlink to a server page that will:

• Get full details from staff table

• Build a web page to display full details of that member of staff

Scan from Martyn’s book!