Software Engineering
Lesson #04 - Practice
Lesson #04 - Practice
Agenda: Lesson #04 - Software Engineering - Practice
1 Class Diagrams: Advanced Concepts
2 Class Work
3 Q & A
Agenda: Lesson #04 - Software Engineering - Practice
1 Class Diagrams: Advanced Concepts
2 Class Work
3 Q & A
Class Diagrams
The UML uses the generalization symbol to show generalization
If we need to show classification, use a dependency with the
«instantiate» keyword
Class Diagrams: Advanced Concepts
Classification and Generalization
Classification refers to the relationship between an object and its
type
Mainstream programming languages assume that an object belongs
to a single class
Class Diagrams: Advanced Concepts
Multiple and Dynamic Classification
In single classification, an object belongs to a single type, which may
inherit from supertypes
In multiple classification, an object may be described by several types
that are not necessarily connected by inheritance
Class Diagrams: Advanced Concepts
Multiple and Dynamic Classification
In multiple classification
Class Diagrams: Advanced Concepts
Multiple and Dynamic Classification
Dynamic classification allows objects to change class within the
subtyping structure; static classification does not
With static classification, a separation is made between types and
states; dynamic classification combines these notions
Class Diagrams: Advanced Concepts
Multiple and Dynamic Classification
Association classes allow you to add attributes, operations, and other
features to associations
class Person
List getAttendances()
List getMeetings()
Class Diagrams: Advanced Concepts
Association Class
Promoting an association class to a full class
Class Diagrams: Advanced Concepts
Association Class
Several languages, most noticeably C++, have the notion of a
parameterized class, or template
Templates are on the list to be included in Java and C# in the near
future
class Set <T> {
void insert (T newElement);
void remove (T anElement);
Set <Employee> employeeSet;
Class Diagrams: Advanced Concepts
Template (Parameterized) Class
A use of a parameterized class, such as Set<Employee>, is called a
derivation
Class Diagrams: Advanced Concepts
Template (Parameterized) Class
Enumerations are used to show a fixed set of values that don't have
any properties other than their symbolic value
They are shown as the class with the
«enumeration» keyword
Class Diagrams: Advanced Concepts
Enumerations
An active class has instances, each of which executes and controls its
own thread of control
Method invocations may execute in a client's thread or in the active
object's thread
Class Diagrams: Advanced Concepts
Active Class
Visibility is a subject that is simple in principle but has complex
subtleties
The simple idea is that any class has public and private elements
Public elements can be used by any other class; private elements can
be used only by the owning class
Class Diagrams: Advanced Concepts
Visibility
Standard UML does not show any information about message calls on
class diagrams
Class Diagrams: Advanced Concepts
Messages
Often, it's handy to show responsibilities on a class in a class diagram
The best way to show them is
as comment strings in their
own compartment in the class
Class Diagrams: Advanced Concepts
Responsibilities
The UML refers to an operation or an attribute that applies to a class
rather than to an instance as static
This is equivalent to static members in C - based languages
Static features are underlined on a class diagram
Class Diagrams: Advanced Concepts
Static Operations and Attributes
Aggregation is the part-of relationship
As well as aggregation, the UML has the more defined property of
composition
Class Diagrams: Advanced Concepts
Aggregation and Composition
Derived properties can be calculated based on other values. When we
think about a date range, we can think of three properties: the start
date, the end date, and the number of days in the period
These values are linked, so we can think of the length as being
derived from the other two values
Class Diagrams: Advanced Concepts
Derived Properties
An abstract class is a class that cannot be directly instantiated.
Instead, you instantiate an instance of a subclass
Typically, an abstract class has one or more operations that are
abstract
Classes have two kinds of relationships with interfaces: providing and
requiring
A class provides an interface if it is substitutable for the interface
Class Diagrams: Advanced Concepts
Interfaces and Abstract Classes
A Java example of interfaces
and an abstract class
Class Diagrams: Advanced Concepts
Interfaces and Abstract Classes
Reference objects are such things as Customer. Here, identity is very
important because you usually want only one software object to
designate a customer in the real world
Value objects are such things as Date. You often have multiple value
objects representing the same object in the real world
Class Diagrams: Advanced Concepts
Reference Objects and Value Objects
A qualified association is the UML equivalent of a programming
concept variously known as associative arrays, maps, hashes, and
dictionaries. Diagram shows a way that uses a qualifier to represent
the association between the Order and Order Line classes
Class Diagrams: Advanced Concepts
Qualified Associations
Agenda: Lesson #04 - Software Engineering - Practice
Q & A

Lesson #04 - Software Engineering - Practice.pdf

  • 1.
  • 2.
    Lesson #04 -Practice
  • 3.
    Agenda: Lesson #04- Software Engineering - Practice 1 Class Diagrams: Advanced Concepts 2 Class Work 3 Q & A
  • 4.
    Agenda: Lesson #04- Software Engineering - Practice 1 Class Diagrams: Advanced Concepts 2 Class Work 3 Q & A
  • 5.
  • 6.
    The UML usesthe generalization symbol to show generalization If we need to show classification, use a dependency with the «instantiate» keyword Class Diagrams: Advanced Concepts Classification and Generalization
  • 7.
    Classification refers tothe relationship between an object and its type Mainstream programming languages assume that an object belongs to a single class Class Diagrams: Advanced Concepts Multiple and Dynamic Classification
  • 8.
    In single classification,an object belongs to a single type, which may inherit from supertypes In multiple classification, an object may be described by several types that are not necessarily connected by inheritance Class Diagrams: Advanced Concepts Multiple and Dynamic Classification
  • 9.
    In multiple classification ClassDiagrams: Advanced Concepts Multiple and Dynamic Classification
  • 10.
    Dynamic classification allowsobjects to change class within the subtyping structure; static classification does not With static classification, a separation is made between types and states; dynamic classification combines these notions Class Diagrams: Advanced Concepts Multiple and Dynamic Classification
  • 11.
    Association classes allowyou to add attributes, operations, and other features to associations class Person List getAttendances() List getMeetings() Class Diagrams: Advanced Concepts Association Class
  • 12.
    Promoting an associationclass to a full class Class Diagrams: Advanced Concepts Association Class
  • 13.
    Several languages, mostnoticeably C++, have the notion of a parameterized class, or template Templates are on the list to be included in Java and C# in the near future class Set <T> { void insert (T newElement); void remove (T anElement); Set <Employee> employeeSet; Class Diagrams: Advanced Concepts Template (Parameterized) Class
  • 14.
    A use ofa parameterized class, such as Set<Employee>, is called a derivation Class Diagrams: Advanced Concepts Template (Parameterized) Class
  • 15.
    Enumerations are usedto show a fixed set of values that don't have any properties other than their symbolic value They are shown as the class with the «enumeration» keyword Class Diagrams: Advanced Concepts Enumerations
  • 16.
    An active classhas instances, each of which executes and controls its own thread of control Method invocations may execute in a client's thread or in the active object's thread Class Diagrams: Advanced Concepts Active Class
  • 17.
    Visibility is asubject that is simple in principle but has complex subtleties The simple idea is that any class has public and private elements Public elements can be used by any other class; private elements can be used only by the owning class Class Diagrams: Advanced Concepts Visibility
  • 18.
    Standard UML doesnot show any information about message calls on class diagrams Class Diagrams: Advanced Concepts Messages
  • 19.
    Often, it's handyto show responsibilities on a class in a class diagram The best way to show them is as comment strings in their own compartment in the class Class Diagrams: Advanced Concepts Responsibilities
  • 20.
    The UML refersto an operation or an attribute that applies to a class rather than to an instance as static This is equivalent to static members in C - based languages Static features are underlined on a class diagram Class Diagrams: Advanced Concepts Static Operations and Attributes
  • 21.
    Aggregation is thepart-of relationship As well as aggregation, the UML has the more defined property of composition Class Diagrams: Advanced Concepts Aggregation and Composition
  • 22.
    Derived properties canbe calculated based on other values. When we think about a date range, we can think of three properties: the start date, the end date, and the number of days in the period These values are linked, so we can think of the length as being derived from the other two values Class Diagrams: Advanced Concepts Derived Properties
  • 23.
    An abstract classis a class that cannot be directly instantiated. Instead, you instantiate an instance of a subclass Typically, an abstract class has one or more operations that are abstract Classes have two kinds of relationships with interfaces: providing and requiring A class provides an interface if it is substitutable for the interface Class Diagrams: Advanced Concepts Interfaces and Abstract Classes
  • 24.
    A Java exampleof interfaces and an abstract class Class Diagrams: Advanced Concepts Interfaces and Abstract Classes
  • 25.
    Reference objects aresuch things as Customer. Here, identity is very important because you usually want only one software object to designate a customer in the real world Value objects are such things as Date. You often have multiple value objects representing the same object in the real world Class Diagrams: Advanced Concepts Reference Objects and Value Objects
  • 26.
    A qualified associationis the UML equivalent of a programming concept variously known as associative arrays, maps, hashes, and dictionaries. Diagram shows a way that uses a qualifier to represent the association between the Order and Order Line classes Class Diagrams: Advanced Concepts Qualified Associations
  • 27.
    Agenda: Lesson #04- Software Engineering - Practice Q & A