What is Inversion of Control?
What is Inversion of Control?
What is Inversion of Control?
For two objects, Foo and Bar the relationships can be defined Association – I have a relationship with an object. Foo uses Bar public class Foo { private Bar bar; }; NB: See Fowler’s definition – the key is that Bar is semantically related to Foo rather than just a dependency (like an int or … Read more
Interface vs Base class
You can find an overview of a lot of design patterns in Wikipedia. It also mentions which patterns are mentioned by GoF. I’ll sum them up here and try to assign as many pattern implementations as possible, found in both the Java SE and Java EE APIs. Creational patterns Abstract factory (recognizeable by creational methods … Read more
If you think about the Greek roots of the term, it should become obvious. Poly = many: polygon = many-sided, polystyrene = many styrenes (a), polyglot = many languages, and so on. Morph = change or form: morphology = study of biological form, Morpheus = the Greek god of dreams able to take any form. … Read more
What’s the difference between a method and a function?
What is an example of the Liskov Substitution Principle?
Interface vs Abstract Class (general OO)
You are “hiding” data from users of your object that should be able to use it without needing to know about its internals. The main reason for this is to allow you to later change these internals without breaking the code that calls into your object. This is a technique to improve software maintainability. Common … Read more
From https://docs.python.org/2/tutorial/classes.html : The simplest form of class definition looks like this: class ClassName: <statement-1> . . . <statement-N>