BasicClassDiagrams

BasicClassDiagrams - Objects, Classes, and Basic Class...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Objects, Classes, and Basic Class Diagrams CS/SWE 421 Introduction to Software Engineering Dan Fleck (Slides adapted from Dr. Stephen Clyde with permission)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to Objects Objects are the fundamental building blocks of object-oriented systems What is an object? It represents any “thing” It has a boundary in space and time It is an abstraction It encapsulates state and/or behavior It has identity
Background image of page 2
Introduction to Objects What aren’t objects? Events (sometimes) Relationships between objects (most of the time) Behavior (most of the time) Constraints (most of the time)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Exercise - Object Hunt Part 1 - List examples of objects in the Third National Bank Elevator System Part 2 - List some concepts from this system that would not typically be modeled as objects
Background image of page 4
Introduction to Classes Most systems have large numbers of objects that come and go throughout the systems’ lifetimes Humans naturally classify similar things by their observable properties Watch how little children reference things Classes are abstractions that allow us to deal with whole collections of objects that share some commonalties
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to Classes Examples of classes in a Student Records Management System Student Course Class Section Instructor Class Grade Major Department College Semester
Background image of page 6
Three Perspectives Objects and classes, as well as all other modeling components in UML, can be interpreted from different perspectives: Three common perspectives: Analysis - description of the problem domain Specification - logical description of software system Implementation - description of software components and their deployment
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Classes from different Perspectives Meaning from three perspectives Analysis : sets of objects Specifications : interfaces to encapsulated software representations of objects Implementations : abstract data types Student Analysis Specification Student {Joe, Sue, Mary, Frank, Tim, …} Interface Student {…} Implementation class Student {…} Student
Background image of page 8
Class Syntax A box divided into compartments Name Attributes Operations Responsibilities Used-defined compartments Student major: String gpa: Real standing: String add(Class Section) drop(Class Section) -- The set of students known to the registration system -- An exception occurs if gpa falls below 2.0
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Class Names The name should be a noun or noun phrase The name should be singular and description of each object in the class The name should be meaningful from a problem-domain perspective “Student” is better than “Student Data” or “S-record” or any other implementation driven name Avoid jargon in the names Try to make the name descriptive of the class’s common properties
Background image of page 10
Class Name Syntax A class name may be text consisting of any
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 51

BasicClassDiagrams - Objects, Classes, and Basic Class...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online