- Why should the open closed principle be used when designing a class?
- Can you build a website without a framework?
- What is a framework and how does it differ from a pattern?
Why should the open closed principle be used when designing a class?
The general idea of this principle is great. It tells you to write your code so that you will be able to add new functionality without changing the existing code. That prevents situations in which a change to one of your classes also requires you to adapt all depending classes.
Can you build a website without a framework?
The short answer is yes. There are plenty of websites out there that are built without using a framework; GitHub and YouTube are probably the most popular ones. The long answer might be a little more complicated than you think.
What is a framework and how does it differ from a pattern?
A framework is a set of related classes to perform a certain task. Those classes may or may not implement a certain design pattern. A design pattern is a well-established design for tackling a problem. A framework is an actual package of code you use to make building applications easier.