Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

solid principles in programming

Source:
https://www.geeksforgeeks.org/solid-principle-in-programming-understand-with-real-life-examples/

1. Single Responsibility Principle: It states that 
	“a class should have only one reason to change” 
    which means every class should have a single responsibility
    or single job or single purpose.

2. Open/Closed Principle: It states that
	“software entities (classes, modules, functions, etc.) should be open for 
  	extension, but closed for modification” which means you should be able to 
    extend a class behavior, without modifying it.

3. Liskov’s Substitution Principle: According to this principle “Derived or 
	child classes must be substitutable for their base or parent classes“. 
    This principle ensures that any class that is the child of a parent class 
	should be usable in place of its parent without any unexpected behavior.

4. Interface Segregation Principle: It states that “do not force any client 
	to implement an interface which is irrelevant to them“. Here you should 
    prefer many client interfaces rather than one general interface and 
  	each interface should have a specific responsibility.

5. Dependency Inversion Principle: High-level modules/classes should not depend 
	on low-level modules/classes. Both should depend upon abstractions.
	Abstractions should not depend upon details. 
  	Details should depend upon abstractions.
Comment

PREVIOUS NEXT
Code Example
Java :: thymeleaf string not equal 
Java :: how to generate random number in java 
Java :: Char in scanner 
Java :: android push notification icon 
Java :: java 16 raspberry pi 
Java :: change javahome cmd 
Java :: get current unix timestamp java 
Java :: java collection to list 
Java :: get absolute path from relative java 
Java :: indexoutofboundsexception java 
Java :: java random unique number 
Java :: android studio Clearing shared preferences; 
Java :: jframe visible 
Java :: android create snackbar 
Java :: java encrypt string 
Java :: arraylist java 
Java :: clear text field in java 
Java :: fill an array with random numbers between 1 and 100 java 
Java :: how to convert int into int array of digits in java 
Java :: java divisible by operator 
Java :: jframe change icon 
Java :: java send request 
Java :: java create list integer range 
Java :: Validation failed for query for method public abstract java.util.List 
Java :: Java how to make a number with digits 
Java :: get timezone offset java 
Java :: jbutton close jframe java 
Java :: java spring boot json deserialize date inaccurate 
Java :: responseentity spring boot 
Java :: java leap year 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =