Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
45 Cards in this Set
- Front
- Back
Law Of Demeter: A method m of object O may only invoke methods from: |
1. O itself 2. m's parameters 3. Any objects created/instantiated within m 4. O's direct component objects 5. A global variable, accessible by O, in the scope of m |
|
Liskov Substitution principle |
if S is a subtype of T, then objects of type T may be replaced with objects of type S |
|
Liskov substition principles states that the preconditions of a subclass |
must be same or weaker than a superclass |
|
and that post conditions of a subclass |
must have same or stronger postconditions than a superclasses. |
|
Open/Close principle states that |
"classes should be open for extension, but closed for modification"; |
|
Comments |
Can be deoderant |
|
Refactor Comments by: |
Extract Method |
|
Duplicated Code (Smell): |
Extract Method Extract Class Pull Up Method Form Template Method |
|
Extract Method: |
Turn the fragment into a method whose name explains the purpose of the method. |
|
Pull Up Method |
You have methods with identical results on subclasses. Move them to the superclass. |
|
Form Template Method |
You have two methods in subclasses that perform similar steps in the same order, yet the steps are different. Get the steps into methods with the same signature, so that the original methods become the same. Then you can pull them up. |
|
4 forms of requirements gathering: |
Elicitation Analysis Specification Validation |
|
Elicitation |
Gathering information
|
|
Analysis |
Determine if you should continue to elicit data |
|
Specification |
Determine User Stories |
|
Validation |
Check if user story is clear, not ambigous, make sure client understands it |
|
Factory: |
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. |
|
Factory is a |
Creational Pattern |
|
Singleton |
* Ensure a class has only one instance, and provide a global point of access to it.
* Encapsulated "just-in-time initialization" or "initialization on first use". |
|
Singleton is |
Creational Pattern |
|
Decorator |
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. |
|
Decorator is |
Structural |
|
Proxy |
* Provide a surrogate or placeholder for another object to control access to it.
|
|
Proxy is |
Strucutural |
|
Template |
* Base class declares algorithm 'placeholders', and derived classes implement the placeholders.
|
|
Template is |
Behavioural |
|
Composite |
* Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
* "Directories contain entries, each of which could be a directory." |
|
Composite is |
Structural |
|
Adapter |
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces. |
|
Adapter is |
Structural |
|
Observer |
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. Think Auctions |
|
Observer is |
Behavioural |
|
AntiPatters are |
-common defective processes and implementations within organizations. -Think Golden Hammer, our process fits all/"I have a hammer and everything else is a nail." |
|
Neilsons Principles (NP) 1 |
Match the Real World System should speak the users’ language, with words, phrases and concepts familiar to the user, rather than system-oriented terms |
|
NP 2 |
•Consistency and Standards Users should not have to wonder whether different words, situations, or actions mean the same thing.
|
|
NP3 |
•Help and Documentation |
|
NP4 |
•User Control and Freedom |
|
NP5 |
•Visibility of System Status |
|
NP6 |
•Flexibility and efficiency of use Allow users to tailor frequent actions. |
|
NP7 |
•Error Prevention |
|
NP8 |
•Recognition rather than recall |
|
NP9 |
•Help users recognize, diagnose, and recover from errors |
|
compicated conditional |
simplify conditional |
|
Divergent Change |
If you look at a class and say, "Well, I will have to change these three methods every time I get a new database; |
|
Shotgun Surgery |
You whiff this when every time you make a kind of change, you have to make a lot of little changes to a lot of different classes |