Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java & Object-Oriented Programming Dieter W. Storr August 2001.

Similar presentations


Presentation on theme: "Java & Object-Oriented Programming Dieter W. Storr August 2001."— Presentation transcript:

1 Java & Object-Oriented Programming Dieter W. Storr August 2001

2 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming OODBMS Methods Inheritance UML Classes Objects Variables Subclasses Superclasses Instances OMG OOP

3 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zClasses yMethods are behavioral elements (algorithm, function, procedure) yVariables (data types) yAttributes are data elements (data member, instance variable, data field) zObjects (Instance) yEntities of a Class

4 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming

5 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zOrganize Classes and Class Behavior yInheritance Enables one class(subclass) to inherit all of the behavior and attributes of another class (superclass) yInterfaces Collection of methods that indicate a class has some behavior in addition what it inherits from its superclasses. yPackages A grouping of classes and/or sub-packages

6 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zCreating a Class Hierarchy, e.g. yDragons and Jabberwocks xBoth are large monsters that eat peasants xBoth have sharp claws, powerful teeth, type-A personalities yMedusa, Yeti, Sasquasch, Grue, DustBunny ==> find a superclass and subclasses

7 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zCreating a Class Hierarchy, e.g. yMonster Superclass xBehavior: To be ferocious, terrifying, and bad for the neighborhood xInstance variable: Sex, Color yFlyingMonster Subclass xBehavior: Swooping down on prey, carrying peasants of into the sky, dropping them from great hights

8 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zCreating a Class Hierarchy, e.g. yWalkingMonster Subclass xBehavior: More susceptible to fallen arches yFour Legged Subclass of FlyingMonster xBehavior: ySubclasses Mammal, Reptile, Amphibian

9 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming

10 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming

11 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming class Jabberwock { String color; String sex; boolean hungry; void feedJabberwock() { if (hungry == true) { System.out.println(Yum -- a peasant!); hungry = false; } else System.out.println(No -- already ate.); }

12 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming void showAttributes() { System.out.println(This is a + sex + + color + jabberwock.); if (hungry == true) System.out.println(The jabberwock is hungry.); else System.out.println(The jabberwock is full.); }

13 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zUnified Modeling Language yUML (Unified Modeling Language) is a standard notation for the modeling of real- world objects as a first step in developing an object-oriented design methodology. object-oriented

14 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zIts notation is derived from and unifies the notations of three object-oriented design and analysis methodologies: Grady Booch's methodology for describing a set of objects and their relationships James Rumbaugh's Object-Modeling Technique (OMT) Ivar Jacobson's approach which includes a use case methodology

15 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zUse-Case Modeling yAn actor represents anything that interacts with the system yA use case is a chunk of functionality performed by a system, yielding a measurable result of value for an actor

16 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming A use case diagram is drawn to illustrate that use cases and actors interact by sending stimuli to one another Customer ATM Maintainer Conduct Bank Transactions Run Reports Maintain ATM Machine Bank

17 November 20, 2003 Dieter W. Storr Java & Object-Oriented Programming zScenario zObject (State, Behavior, Identity) zInteraction Diagrams zSequence Diagrams and Scripts zCollaboration Diagrams zLink Notations zClasses and Objects


Download ppt "Java & Object-Oriented Programming Dieter W. Storr August 2001."

Similar presentations


Ads by Google