From the course: Java Refactoring Best Practices
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
SOLID principles - Java Tutorial
From the course: Java Refactoring Best Practices
SOLID principles
- [Instructor] It's time to look at the SOLID principles of object-oriented design and how to apply them in Java code. SOLID is an acronym for five guidelines for designing maintainable and scalable object-oriented software. They provide a framework for designing software that's flexible, extensible, and easy to maintain. I'm going to explain them briefly first and then I'll show you some code examples with and without the best practices applied. The S is for single responsibility principle. This means a class should only have one reason to change because it only has one responsibility. The O is for the open/closed principle. This entails that software entity should be open for extension but closed for modification. The third letter, L, stands for the Liskov substitution principle. This means that subtypes should be substitutable for their base types. The I is for interface segregation principle. This comes down to…
Contents
-
-
-
-
-
(Locked)
Handling exceptions3m 28s
-
(Locked)
Removing dead code and other unnecessary elements3m 36s
-
(Locked)
Java design patterns3m 18s
-
(Locked)
SOLID principles8m 58s
-
(Locked)
Testing your code2m 39s
-
(Locked)
Challenge: Applying exception handling and code clean-up37s
-
(Locked)
Solution: Applying exception handling and code clean-up53s
-
(Locked)
-
-