Interface Segregation Principle- Program to an interface

Robert Martin has a very good explanation of Interface segregation principle (ISP), in his book “UML for Java Programmers”. Based on that, I don’t think ISP is about an interface being “focused” on one logical, coherent group of things. Because, that goes without saying; or, at least it should go without saying. Each class, interface … Read more

How can I serialize internal classes using XmlSerializer?

From Sowmy Srinivasan’s Blog – Serializing internal types using XmlSerializer: Being able to serialize internal types is one of the common requests seen by the XmlSerializer team. It is a reasonable request from people shipping libraries. They do not want to make the XmlSerializer types public just for the sake of the serializer. I recently … Read more

When should I declare variables in a PHP class?

That variable isn’t uninitialized, it’s just undeclared. Declaring variables in a class definition is a point of style for readability. Plus you can set accessibility (private or public). Anyway, declaring variables explicitly has nothing to do with OOP, it’s programming-language-specific. In Java you can’t do that because variables must be declared explicitly.