Relative Content

Tag Archive for object-oriented

Isn’t MVC anti OOP?

The main idea behind OOP is to unify data and behavior in a single entity – the object. In procedural programming there is data and separately algorithms modifying the data.

Looking for some OO design advice

I’m developing an app that will be used to open and close valves in an industrial environment, and was thinking of something simple like this:-

Object behaviour or separate class?

When it comes to OO database access you see two common approaches – the first is to provide a class (say “Customer”) with methods such as Retrieve(), Update(), Delete(), etc. The other is to keep the Customer class fairly lightweight (essentially just properties) and perform the database access elsewhere, e.g. using a repository.

What can go wrong if the Liskov substitution principle is violated?

I was following this highly voted question on possible violation of Liskov Substitution principle. I know what the Liskov Substitution principle is, but what is still not clear in my mind is what might go wrong if I as a developer do not think about the principle while writing object-oriented code.