Week 9 Flashcards
Software Development Lifecycle
Requirements Design Implementation Testing Maintenance
How to Design Software
- Modelling: Identify concepts and relations
- Apply good architecture
- Use appropriate data structures
- Use design patterns when appropriate
- Refactor
Grammatical Parsing - Nouns
Class if it has multiple attributes / operations and they are common to all instances
otherwise: attribute of class
Grammatical Parsing - Adjective
SubClass, Attribute
subclass: if adjective would imply different or additional operations or behavior or different adjectives imply different attributes
Grammatical Parsing - Verb
Method: contains, has , is , uses, consists
Is-a relationship types
Generalization: Generally inheritance, both can exist on their own. One class specialization of other Realization: Implementation or inheritance of abstract class. Interface A has no notion of existence without being a specific tp of object B. E.g. Animal. If I say draw an animal I do not know what to draw -> realization. If I ask to draw a person, I know what to draw -> Generalization
has-a relationship types
Aggregation: one class is part of the other but they can exist idependently Composition: one class part of the other. Cannot exist without the class to which it belongs
uses relationship
Dependency E.g. uses an instance of other class as input
public abstract class Animal {}
public abstract class Mammal extends Animal {}
public class Dog extends Mammal {}
public class Cat extends Mammal {}
Realization relationship bw. all three
Although Mammal “extends” Animal in Java, Animal is an abstract class and thus cannot be realized on its own; therefore, a “realization” relationship is correct. The same holds true for Dog/Cat and Mammal, because Mammal is an abstract class as well.