Lecture 4 Flashcards
how do we represent class and name in uml? and abstract class?
rectangle, words and name start with capital, name can also be pathname package::class. abstract - name is in italics
what are the components of a class rectangle?
0 - name, 1 - attributes, 2 - operations (functions), 3+ - other features
how are attributes represented in UML?
name, can have type, visibility, default value, derived value, multiplicity
explain visibility and symbols (also multiplicity, derived and default value)
+ - public, - - private, # - protected, = - default, / - derived, [] - multiplicity. eg -/age : integer, -date : Date = today, middleName[0…2] (attribute can have 0 - 2 values)
what is the correct uml way to write operation?
have a name, optional: visibility, parameter names and types, return type
what is the difference between instance and class scope?
class-scope attributes - same for all instances of class (interest rate) instance-scope attributes - different instances of the class can have different values default - instance
explain what an association is
-name, roles the participating objects play. eg word that goes on line between 2 classes
explain relationships of different degrees
reflexive - involves instances of the same class binary - degree 2, ternary - degree 3, n-ary - more than 3
multiplicities of higher degree relationships
eg relationship between country, company and product. on product have 0..10, each company can only 10 products to same country
how do we represent constraints?
eg person if related to itself (person marries person), a box that says (p1 and p2 can marry if both over 18) and connected to relationship line with dotted line
what is an association class?
a class that comes off of a relationship line (if the association (relationship) need info about itself or behaviour)
how do we show an object and link diagram?
box(e1 : employee) connected with line to box(p1:permit) and box(p2:permit)