Design

 

Principles of Object-Oriented Design

Single Responsibility Principle (SRP)

The SRP requires that a class should have only a single responsibility.

Open-Closed Principle (OCP)

The OCP requires that each software entity should be open for extension, but closed for modification.

Liskov Substitution Principle (LSP)

The LSP requires that objects in a program should be replaceable with instances of their subclasses without altering the correctness of that program.

Interface Segregation Principle (ISP)

The ISP requires that clients should not be forced to depend on interfaces that they do not use.

Dependency Inversion Principle (DIP)

The DIP requires that high-level modules should not depend on low-level modules, both should depend on abstraction. Also, abstraction should not depend on details, details should depend on abstractions.



Test-driven development (TDD) 

Test-driven development (TDD) is a software development process relying on software requirements being converted to test cases before the software is fully developed, and tracking all software development by repeatedly testing the software against all test cases.


Tips to Optimize Java Code Performance

  • Avoid Writing Long Methods. ...
  • Avoid Multiple If-else Statements. ...
  • Avoid Getting the Size of the Collection in the Loop. ...
  • Avoid Using String Objects For Concatenation. ...
  • Use Primitive Types Wherever Possible. ...
  • Avoid Using BigDecimal Class. ...
  • Avoid Creating Big Objects Often.

Comments

Popular posts from this blog

Java Design Patterns