Be the first to like this
Mat Byrne recently posted source code for a dynamic domain object in PHP which
takes advantage of the dynamic nature of PHP. It’s a good example of how
programmers can take advantage of the unique characteristics of a programming
Statically typed languages such as C# and Java have some advantages: they run
faster and IDE’s can understand the code enough to save typing (with your fingers),
help you refactor your code, and help you fix errors. Although there’s a lot of things I
like symfony, it feels like a Java framework that’s invaded the PHP world. Eclipse
would help you deal with the endless getters and setters and domain object methods
with 40-character names in Java, Eclipse.
The limits of polymorphism are a serious weakness of today’s statically typed
languages. C# and Java apps that I work with are filled with if-then-else or case
ladders when they need to initialize a dynamically chosen instance of one of a set of
classes that subclass a particular base class or that implement a particular interface.
Sure, you can make a HashMap or Dictionary that’s filled with Factory objects, but
any answer for that is cumbersome. I