• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/5

Click to flip

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;

5 Cards in this Set

  • Front
  • Back

Principles of OOP programming ?

(1) DRY (2) SOLID


DRY - In code and in Process.



Examples of SRP (Single Responsibility Principle) ?

Persistence, Validation, Notification, Error Handling, Logging, Class Selection/Construction, Formatting, Parsing , Mapping, Calling Web Services.



Lack of SRP increases Coupling.


What is Open Closed Principle ?

Open for extension, closed for modification.


Use DI.


Refactoring: Extract interface/Apply strategy pattern, Parameterize methods, Form template methods.

What is Liskov Substitution Principle ?

If you get a base type, but you still have to check the actual type of object, it's breaking LSP. Subtypes must be substitutible for their base class.




Refactoring: Collapse Hierarchy, Pull up/down methods and fields.

Is not Functional style programming just like imperative style ?

No.


Imperative styles is like Telling how to do it.


Functional is like what to do.




e.g. stream(2,3,4,5).boxed().collect(toMap(n->n, n-> 2*n))