Transcript lecture4

Lecture 4
UML, XML &
EWorld Configuration Parser
UML Things
Nouns
Explanatory
Structural
things
Behavioral
things
Verbs
Logical
Physical
Grouping
things
Organizational
Annotational
things
Structural logical things
Class
Description of a set of objects that share the same attributes
operations, relationships and semantics. A class implements one
or more interfaces.
+ public
- private
Class is used in class diagrams, which are handy during modeling phase
Structural logical things
Interface
Collection of operations that specify a service of class or component.
An interface describes externally visible behavior of an element.
An interface may represent complete behavior of a class or component
or only part of it. Interfaces defines a set of operation specifications
(signatures) but never a set of operation implementations.
IEntity
In addition to class diagrams Interfaces are used in Component diagrams
which are used for physical modeling of dependencies between
components.
Structural logical things
Collaboration
Defines an interaction that captures some cooperative behavior.
Any class can participate in many collaborations. Collaborations
represent the implementation of patterns that make up the system.
Essentially, think of collaborations as Design Patterns.
Use case
Description of set of sequences of actions that a system performs that
yields an observable result of value to a particular actor.
Use case is used to structure the behavioral things in a model. A use
case is realized by collaboration.
Active class
Class whose objects own one or more processes or threads and,
therefore can initiate control activity. An active class is just like
a class except that its objects represent elements whose behavior
is concurrent with other elements.
Structural physical things
Component
Is a physical and replaceable part of a system that provides realization
of a set of interfaces. For example, Java Beans and ActiveX controls
are examples of such components. Components represent physical
packaging of logical elements such as classes, interfaces and
collaborations.
Component
Node
Physical element that exists at run time
and represents computational resource, generally having at least some
memory and, often, processing capability. A set of components may
reside on a node and can migrate from node to node.
Node
Behavioral things
Dynamic parts of UML models
Interaction
Behavior that comprises set of messages exchanged among a set of
objects within particular context to accomplish specific purposes.
Interaction involves a number of elements such as messages, action
sequences.
State machine
Behavior that specifies the sequences of states an object or interaction
goes through during its lifetime in response to events. The behavior of
individual class or classes maybe captured by state machine. State
machine consists of states, transitions and events.
Reading token
Grouping things
Organizational parts of UML models
Packages
General-purpose mechanism for organizing elements into groups.
Structural things, behavioral things and grouping things maybe placed
in the package. Unlike components, packages are purely conceptual.
Package
Annotational things
Explanatory parts of UML models
Note
Symbol for rendering constraints and comments attached to an element.
Just a note!
Contains some
important information
Relationships in UML
Dependency
Semantic relationship between two things in which change in one thing
may affect the semantics of the other thing. Simply think of this
as a dependency between a class and parameter to one of its methods
Relationships in UML
Association
Structural relationship that describes a set of links, connections between
objects. Aggregation is a special kind of association relationship; it is
a relationship between a whole and its part.
<<Interface>>
Collection
+contains
+contained by
0..*
0..*
<<Interface>>
Element
May contain
by reference or
by value.
Usually contains
by value when
come to existence
and go away
together.
Relationships in UML
Generalization
Specialization/generalization relationship in which objects of the
specialized element (the child) are substitutable for objects of the
generalized element (the parent). Child shares structure and and
interface with parent. This is essentially an inheritance relationship.
GenericTag
ComponentTag
ContainerTag
Relationships in UML
Realization
Semantic relationship between classifiers. One classifier specifies the
contract, the other guarantees to carry it out. Realization relationships
can be encountered between interfaces and classes or components or
between use cases and collaborations that realize them
<<I n te rf a ce >>
I Tag
GenericTag
<EWORLD NAME=Simple CLASS=edu.nyu.sejava.iskold.eworld.Eworld>
<!-- Eworld renderer -->
<RENDERER CLASS=edu.nyu.sejava.iskold.eworld.EworldRnd>
<PROPERTY NAME=BACKGROUND CLASS=java.awt.Color VALUE=#FFFFFF>
<PROPERTY NAME=FOREGROUND CLASS=java.awt.Color VALUE=#000000>
<PROPERTY NAME=WIDTH CLASS=java.lang.Integer VALUE=500>
<PROPERTY NAME=HEIGHT CLASS=java.lang.Integer VALUE=500>
</RENDERER>
<!-- Desert site -->
<SITE NAME=Desert CLASS=edu.nyu.sejava.iskold.eworld.sites.Desert>
<!-- Desert renderer -->
<RENDERER CLASS=edu.nyu.sejava.iskold.eworld.sites.DesertRnd>
<PROPERTY NAME=X CLASS=java.lang.Integer VALUE=0>
<PROPERTY NAME=Y CLASS=java.lang.Integer VALUE=0>
<PROPERTY NAME=HEIGHT CLASS=java.lang.Integer VALUE=100>
<PROPERTY NAME=WIDTH CLASS=java.lang.Integer VALUE=100>
</RENDERER>
<!-- Entity in the desert -->
<ENTITY CLASS=edu.nyu.sejava.iskold.eworld.entities.BasicEntity>
<PROPERTY NAME=GENE CLASS=java.lang.String VALUE=ACGTGGGTCT>
<RENDERER CLASS=edu.nyu.sejava.iskold.eworld.EworldRnd>
<PROPERTY NAME=BACKGROUND CLASS=java.awt.Color VALUE=#FF00FF>
</RENDERER>
</ENTITY>
<!-- Another poor entity -->
<ENTITY CLASS=edu.nyu.sejava.iskold.eworld.entities.BasicEntity>
<PROPERTY NAME=GENE CLASS=java.lang.String VALUE=GTGGGGAGGTCT>
<RENDERER CLASS=edu.nyu.sejava.iskold.eworld.EworldRnd>
<PROPERTY NAME=BACKGROUND CLASS=java.awt.Color VALUE=#F300F3>
</RENDERER>
</ENTITY>
<!-- Resource: Pile of A -->
<RESOURCE CLASS=edu.nyu.sejava.iskold.eworld.resources.PileOfA>
<PROPERTY NAME=QUANTITY CLASS=java.lang.Integer VALUE=3>
<RENDERER CLASS=edu.nyu.sejava.iskold.eworld.resources.PileOfARnd>
<PROPERTY NAME=BACKGROUND CLASS=java.awt.Color VALUE=#ACFFBB>
<PROPERTY NAME=FOREGROUND CLASS=java.awt.Color VALUE=#06CBBB>
</RENDERER>
</RESOURCE>
</SITE>
</EWORLD>
XML
XML is a meta language
Every tag may have attributes and children
<email>
<from>Alex Iskold</from>
<to>Students of SE Java, 2002</from>
<message>
XML does not mix syntax & semantics!
</message>
</email>
But in HTML
<html>
<body>
<h1>From: Alex Iskold</h1>
<h1>To: Students of SE Java, 2002</h1>
<b>XML does not mix syntax &
semantics!</b>
</body>
</html>
Tag name
Attribute
name
Attribute
value
<ENTITY NAME=“entity1” TYPE=“Predator”>
<PROPERTY COLOR=“Blue”>
<PROPERTY GENE=“atgcgttta”>
</ENTITY>
Child tag
Please find and read about UML
and XML on the web