1/63
Looks like no tags are added yet.
What are “Things” in the problem domain
those items users work with when accomplishing tasks that need to be remembered (from the real world!)
Examples of “Things” are products, sales, shippers, customers, invoices, payments, etc.
These “Things” are modeled as domain classes or data entities
In this course, we will call them domain classes. In database class you may call them data entities
what is a problem domain
the specific area (or domain) of the users’ business need that is within the scope of the new system.
The context of which u are working
Ex. if you are in sales, sales is ur domain
two techniques for identifying “things”
brainstorming technique
noun technique
brainstorming technique - basic def
Use a checklist of all of the usual types of things typically found and brainstorm to identify domain classes of each type
noun technique - basic def
Identify all of the nouns that come up when the system is described and determine if each is a domain class, an attribute, or not something we need to remember
identify problem domain classes (things) by finding, classifying, and refining a lits of nouns that come up in discussions or documents
Popular, systematic technique
CONS:
Does end up with long lists and many nouns that are not things that need to be stored by the system
Difficulty identifying synonyms and things that are really attributes
Good place to start when there are no users available to help brainstorm
types of things
Two Really Old Dogs Sleep Inside

steps of brainstorming technique (full version)
1. Identify a user and a set of use cases
2. Brainstorm with the user to identify things involved when carrying out the use case—that is, things about which information should be captured by the system.
3. Use the types of things (categories) to systematically ask questions about potential things, such as the following:
Are there any tangible things you store information about?
Are there any locations involved?
Are there roles played by people that you need to remember?
4. Continue to work with all types of users and stakeholders to expand the brainstorming list
5. Merge the results, eliminate any duplicates, and compile an initial list
noun technique - steps (full version)
Using the use cases, actors, and other information about the system, identify all nouns that might include: (product item, sale, confirmation, transaction, change request etc)
Using other information from existing systems, current procedures, and current reports or forms, add items or categories of information needed. (ex. price, size color style season, quantity)
as this list of nouns build, refine it, and decide what should be included (ex. is it a unqiue thing we need to know about? is it in scope? does system need to remember 1+ of these? Is it redundant? Is it acc an output or input?)
Create a master list of all nouns identified then note wheather each one should be included, excluded or researched further
review list with users, stakeholders, team members, and define the list of things in problem domain
attributes and values → relationship
Each instance of a class is an object which has its own values per attribute
Building blocks for how we build data classes
attribute
escribes one piece of information about each instance of the class
EX: Customer (class) has attributes: first name, last name, phone number, address
identifier or key
One attribute uniquely identifies an instance of the class. Required for data entities, optional for domain classes.
important for database reasons- ex. Linking tables
EX: A Customer ID (attribute) identifies a customer (class)
compound attribute
Two or more attributes combined into one structure to simplify the model. (E.g., address rather than including number, street, city, state, zip separately).
Sometimes an identifier or key is a compound attribute.
ex. Address would have streets, state, zip all together instead of separately
association
a naturally occurring relationship between classes (a UML term)
How do we extend data classes to create relationships?
Ex. in retail with customer and orders, the customer would need to be linked with the order the customer made, and the order would be linked with items
associations vs relationships
multiplicity vs cardinality
association = class diagram in UML
multiplicity = number of associations between classes: 1 to 1 or 1 to many
relationship = ERD database class
cardinality = number of relationships in entity relationship diagrams: 1 to 1 or 1 to many
Associations and Relationships can apply in two directions and can be read separately each way
EX: A customer places an order —> An order is placed by a customer
two ways to do class modeling
ERD and domain modeling are the two ways to do class modeling!
what is the concept of multiplicity/cardinality
the number of links that occur in a particular association between a thing(object) and one or more other things (objects)
How many of Object A connect to Object B?
Example: One Customer can place 0 to many Orders (a brand-new user hasn't ordered yet). But every Order must belong to exactly 1 Customer.
minimum and maximum multiplicity constraints
minimum is zero, the association is optional
If minimum is at least one, the association is mandatory
Ex. if you join a website but do not make an order, you need the ability to make an order = needs multiplicity/cardinality is zero or more
Ex. if mr smith places an order, you need the name of he order bc the order cannot process w/o knowing this = a 1 and only 1 mandatory relationship!
Ex. if mr smith order 1 or more items = you need one or more mandatory relationship!
binary association
Associations between exactly two different classes
ex. Course Section includes Students
Members join Club
unary association (recursive)
Associations between two instances of the same class
ex. Person married to person
Part is made using parts
ternary association
association among three diff types of things
N-nary association
an association among any number of different types of things
ERD (entity relationship diagram)
term for “things” in ERD models
used for many years to develop data models that are used in database development
The term for “things” in ERD models is data entities
ERD models are not UML models and do not use standard UML notation
ERD models are not as expressive as UML models
They do not model generalization/specialization well
They do not model whole/part well
ERD notation example


ERD notation types —> fill in the blanks

expanded ERD with attributes example

semantic net
A semantic net is a graphical representation of an individual data entity and its relationship with other individual entities
shows specific objects that belong to a class or data entity and the links among them
It is often used to help understand and then develop an ERD model

ERD for a bank with many branches - USE AS STUDY QUIZ
QUESTIONS:
What are the key fields?
How many accounts can a customer have?
How many branches can a customer be assigned to?
How many customers can a branch have?
Another example is shown in Figure 4-10. This ERD is for a bank that
has many branches. Each branch has one or more accounts. Each account is
owned by one customer and results in one or more transactions. There are a few
other issues to consider in the bank example. First, there is no data entity named
Bank. That is because the ERD shows data storage requirements for the bank.
There is only one bank. Therefore, there is no need to include Bank in the model.
This is a general rule that applies to ERDs. If the system were for state bank
regulators, then Bank would be an important data entity because there are lots
of banks under the state regulators’ jurisdiction.
Look again at the cardinality. Note that a customer must have at least
one account. The rationale for this is that the bank would not add a customer
unless he or she was adding an account. Note also that the branch can have zero
accounts. A branch might be added long before it opens its doors, so it is possible
that it is does not have any accounts. Additionally, there might be some branches
that do not have accounts, such as a kiosk at a university or airport. Note that
an account must have at least one transaction. The rationale is that opening a
new account requires an initial deposit, which is a transaction. It is important to
recognize that questions about the cardinality and minimum and maximum car-
dinality constraints need to be discussed and reviewed with stakeholders.

Domain model class diagram
class
domain class
class diagram
Class
A type of classification used to describe a collection of objects
Domain Class
Classes that describe objects in the problem domain
Class Diagram
A UML diagram that shows classes with attributes and associations (plus methods if it models software classes)
Domain Model Class Diagram
A class diagram that only includes classes from the problem domain, not software classes so no methods
UML class notation
domain class a name and attributes (no methods)
class name always capitalized
attribute names not capitalized and use camelback notation (words run together and second word is capitalized)
Compound class names also use camelback notation


UML notation for multiplicity —> check what this actually MEANS

association class
an association that is treated as a class in a many to many association because it has attributes that need to be remembered
(ex. such as grade in classroom-student-course)
association class properties
what is the key of the association class
The association class is the same “thing” as the association itself
The unique identifier (key) for the association class is the concatenation of the keys of the attached classes
In the previous example the key for CourseSection is CourseNumber+SectionNumber
Hence the key for CourseEnrollment is CourseNumber+SectionNumber+StudentID
Note: If more information is required to uniquely identify instances of the association class, then the model is incorrect, i.e., if the key cannot be formed by the concatenation of the endpoint keys, it is in error.
band members and concerts UML class diagram questions
in slides for ch 4
generalization/specialization
hierarchical relationship where subordinate classes are special types of the superior classes.
Often called an Inheritance Hierarchy
Superclass
the superior or more general class in a generalization/specialization hierarchy
subclass
the subordinate or more specialized class in a generalization/specialization hierarchy
Inheritance
the concept that subclasses classes inherit characteristics of the more general superclass
example of generalization/specialization

abstract class
a class that allow subclasses to inherit characteristics but never gets instantiated. In Italics (Sale)

concrete class
a class that can have instances

inheritance indicator
the ARROW indicates the class inherits from the one being pointed from
attributes of OnlineSale are:
timeOnSite, chatUse, saleDateTime, priorityCode, S&H

Whole-part relationship
a relationship between classes where one class is part of or a component portion of another class
Aggregation
what symbol is it indicated by
a whole part relationship where the component part exists separately and can be removed and replaced (UML diamond symbol on next slide)
Computer has disk storage devices (storage devices exist apart from computer)
Car has wheels (wheels can be removed and still be wheels

composition
what symbol is it indicated by
a whole part relationship where the parts cannot be removed (filled in diamond symbol)
OrderItem on an Order (without the Order, there are no OrderIterms)
Chip has circuits (without the chip, there are no circuits)
are relationships the same as association?
NO
three types of relationships in class diagrams
Association Relationships
These are associations discussed previously, just like ERD relationships
Whole Part Relationships
One class is a component or part of another class
Generalizations/Specialization Relationships
Inheritance
what is object behaviour
Each class has objects that may have status conditions or “states”
Object behavior consists of the various states and the movement between these states
state
a condition during an object’s life when it satisfies some criterion, performs an action, or waits for an event
transition
the movement of an object from one state to another
state machine diagram
a diagram which shows the life of an object in states and transition
origin state
the original state of an object before it begins a transition
destination state
the state to which an object moves after completing a transition
pseudostate
the starting point in a state machine diagram. n
noted by a black circle
action-expression
some activity that must be completed as part of a transition
guard condition
a true/false test to see whether a transition can fire
state machiene diagram —> fill in the blank w/ an on/off button example

concurrency in a state machiene diagram - 3 terms
concurrent states
path
concurrent paths
concurrent states
when an object is in one or more states at the same timep
path
a sequential set of connected states and transitions
concurrent paths
when multiple paths are being followed concurrently
ie. when one or more states in one path are parallel to states in another path
printer with concurrent paths example

steps to create a state machine diagram
1. Review the class diagram and select classes that might require state machine diagrams
2. For each class, make a list of status conditions (states) you can identify
3. Begin building diagram fragments by identifying transitions that cause an object to leave the identified state
4. Sequence these states in the correct order and aggregate combinations into larger fragments
5. Review paths and look for independent, concurrent paths
6. Look for additional transitions and test both directions
7. Expand each transition with appropriate message event, guard condition, and action expression
8. Review and test the state machine diagram for the class
Make sure state are really state for the object in the class
Follow the life cycle of an object coming into existence and being deleted
Be sure the diagram covers all exception condition
Look again for concurrent paths and composite states
how to make a state machine diagram - summarized
Choose a single object class.
Identify the states and exit transitions
Identify concurrent paths
Identify additional paths
Build the State Machine Diagram
RMO example of all steps to make a state machiene diagram
in ch 4 slides 57 - 62