DOC PREVIEW
SJSU CMPE 196G - Software Patterns
Pages 45

This preview shows page 1-2-3-21-22-23-43-44-45 out of 45 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Software PatternsSlide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Classes in UML (1)Slide 17Classes in UML (3)Classes in UML (4)Classes in UML (5)Objects in UML (1)Objects in UML (2)Slide 23Objects in UML (4)Objects in UML (5)Attributes in UML (1)Attributes in UML (2)Attributes in UML (3)Attributes in UML (4)Operations, Methods in UML (1)Operations, Methods in UML (2)Operations, Methods in UML (3)Operations, Methods in UML (4)Operations, Methods in UML (5)Constraints in UML (1)Constraints in UML (2)Constraints’ Examples in UML (3)Constraints’ Examples in UML (4)Constraints’ Examples in UML (5)Constraints’ Examples in UML (6)Constraints’ Examples in UML (7)Constraints’ Examples in UML (8)Constraints’ Examples in UML (9)Notes in UML (1)Notes in UML (2)2003SJSU -- CmpE L3-S1 Class DiagramsSoftware PatternsDr. M.E. Fayad, ProfessorComputer Engineering Department, Room #283I College of EngineeringSan José State UniversityOne Washington SquareSan José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad2003SJSU – CmpE M.E. Fayad L3-S2 Class Diagrams2Lesson 03:Class Diagrams2003SJSU – CmpE M.E. Fayad L3-S3 Class Diagrams Lesson ObjectivesObjectives3 Explore Modeling Notation Understand Objects, Attributes, Operations, and Notes in UMLDiscuss the following:– Different Kind of Classes– Class Diagrams2003SJSU – CmpE M.E. Fayad L3-S4 Class DiagramsNotationNotation Again !Modeling Notation42003SJSU – CmpE M.E. Fayad L3-S5 Class DiagramsReal-world systems can be decomposed into discrete entities called objectsObjects represent things, concepts, or abstraction with definable boundaries and behaviorsAn object is specific instance of a class to which it belongsClasses have attributes and behaviorsIndividual objects have their own specific values for each attribute and share the same behaviorsObjects & Classes (1)52003SJSU – CmpE M.E. Fayad L3-S6 Class DiagramsExample Objects Classes AttributesA computer screen Screen Resolution, # of colorsA window Window Size, locationIBM Company Name, location, total revenue Joe Harris Employee Name, department, salaryObjects & Classes (2)62003SJSU – CmpE M.E. Fayad L3-S7 Class DiagramsObjects & Classes (3)Objects with the same attributes, behaviors, and relationships are grouped together into classesA class describes general attributes and behaviors for a group of objectsAn object is a single instance of its class (e.g., IBM is an instance of the Company class)A Class diagram is used to describe the attributes and behaviors of a class72003SJSU – CmpE M.E. Fayad L3-S8 Class DiagramsClasses (1)Classes are the most important building block of any Classes are the most important building block of any object-oriented systemobject-oriented systemA class is a description of a set of objects that share A class is a description of a set of objects that share the same attributes, operations, relationships, and the same attributes, operations, relationships, and semantics.semantics.Graphically, a class is rendered as a rectangleGraphically, a class is rendered as a rectangle82003SJSU – CmpE M.E. Fayad L3-S9 Class DiagramsClasses (2)9RegistrationFormRegistrationManagerCourseStudentCourseOfferingProfessorScheduleAlgorithm2003SJSU – CmpE M.E. Fayad L3-S10 Class DiagramsNaming & AttributesNaming & AttributesNamingNaming Classes should be named using the vocabulary of the domainClasses should be named using the vocabulary of the domainNaming standards should be created -- e.g., all classes are Naming standards should be created -- e.g., all classes are singular nouns starting with a capital lettersingular nouns starting with a capital letterAttributesAttributesAn attribute is a named property of a class that describes a An attribute is a named property of a class that describes a range of values that instances of the property may holdrange of values that instances of the property may hold102003SJSU – CmpE M.E. Fayad L3-S11 Class DiagramsAttributes11Each course offeringhas a number, location and timeCourseOfferingnumberlocationtime2003SJSU – CmpE M.E. Fayad L3-S12 Class DiagramsOperationsOperationsAn operation is the implementation of a service that An operation is the implementation of a service that can be requested from any object of the class to affect can be requested from any object of the class to affect behaviorbehavior12RegistrationManageraddCourse(Student,Course)2003SJSU – CmpE M.E. Fayad L3-S13 Class DiagramsFinding ClassesWhere to find candidate classes:Where to find candidate classes:o Nouns in descriptions or conversationNouns in descriptions or conversationo Checklists of general/typical object typesChecklists of general/typical object typeso Similar computerized systemsSimilar computerized systemso Technical literature in the problem domainTechnical literature in the problem domain132003SJSU – CmpE M.E. Fayad L3-S14 Class DiagramsExample Classes14Phenomena ClassesThing Car, goods, packaging, materialsPeople & roles Employee, parent, customer, memberOrganizations Company, department, group, projectPlaces Shelf, parking spot, construction site, cityConcepts Square, currency, quality parameters, feeResources Money, time, energy, labor force, infoApparatuses Radar, sensor, valve, motorSystems Street register, cash register, alarm system2003SJSU – CmpE M.E. Fayad L3-S15 Class DiagramsEvaluating ClassesDoes the class contain unique information?Does the class contain unique information?Does the class encompass multiple objects?Does the class encompass multiple objects?Can we identify objects from the class?Can we identify objects from the class?Does the class have a manageable number of Does the class have a manageable number of operations?operations?Does the class embodies a well-defined responsibility?Does the class embodies a well-defined responsibility?152003SJSU – CmpE M.E. Fayad L3-S16 Class Diagrams16Classes in UML (1)ClassAbstractClass<<utility>>UtilityClassattributeoperation()<<Stereotype>>Package::Class{Constraints}Syntax for attributes and operationsAttribute[Cardinality]:Package::Type = InitialValue {Constraints}Operation(ArgumentList):ReturnType {Constraints}<<metaclass>>MetaClass<<ActiveClass>>ActiveClass2003SJSU – CmpE M.E. Fayad L3-S17 Class Diagrams17Classes in UML


View Full Document

SJSU CMPE 196G - Software Patterns

Download Software Patterns
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Software Patterns and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Software Patterns 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?