organization

organization - Organization of Classes Structurally:...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Organization of Classes Structurally: hierarchical, tree, class Object is the ancestor of all classes, each class has one superclass, no cycles. Semantically: is a. class A class B more general more specialized is a Organization of Classes class A class B class C more general more specialized is a is a Any number of levels in the hierarchy. Organization of Classes class A class B class C class D class E more general more specialized One parent; but any number of subclasses can have the same superclass. Biological Classification Animalia Insecta Mammalia Rodentia Primates Lemuridae Hominidae Lepidoptera Kingdom Class Order Family Hierarchical Organization person staff student undergrad graduate faculty Hierarchical Organization Indo-Eurpoean Indo-Iranian Indic Hindi Bengali Iranian Persian Pasto Italic Spanish French Balto-Slavic Slavic Russian Hierarchical Organization Object Number BigDecimal Integer Float Faculty Class Hierarchy The class hierarchy is a tree. A tree is a kind of structure with a root and the other elements are organized so that each element has one branch connecting it to the root. 1. Every class descends from the class Object (the root of the tree). 2. Every class has exactly one superclass (except the class Object ). 3. No class can descend directly or indirectly from itself. Hierarchical Organization class IndoEuropean extends Object { // ... class IndoIranian extends IndoEuropean { // ... class Indic extends IndoIranian { // ... class Hindi extends Indic { // ... class Bengali extends Indic { // ... class Iranian extends IndoIranian { // ... class Persian extends Iranian { // ... class Pasto extends Iranian { // ... class Italic extends IndoEuropean { // ... class Spanish extends Italic { // ... class French extends Italic { // ... class BaltoSlavic extends IndoEuropean { // ... class Slavic extends BaltoSlavic { // ... class Russian extends Slavic { // ... No Multiple Inheritance class X extends Y, Z { } (But Java interfaces can be used in some cases to play this role.) No Cyclic Inheritance class X extends Y { } class Y extends X { } Hierarchical Organization Sometimes the problem domain is naturally organized in a tree-like hierarchy. Sometimes the problem domain is not naturally organized like that. In object-oriented programming we eventually learn the idioms or design patterns to solve different problems using this organization. First, we must learn more of the structure Java provides for object-oriented programming. Note that each class forms an interface, a suite of methods. Interface. In general, an interface is the boundary between distinct systems. Specifically, the specification or protocol governing their interaction....
View Full Document

Page1 / 59

organization - Organization of Classes Structurally:...

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

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