Abstract Factory Method and Polymorphism
Being a PHP programmer for the last couple of years, I’m just starting to get into advanced programming styles and using polymorphic patterns. I was watching a video on polymorphism the other day, and the guy giving the lecture said that if at all possible, you should get rid of if
statements in your code, and that a switch is almost always a sign that polymorphism is needed. At this point I was quite inspired and immediately went off to try out these new concepts, so I decided to make a small caching module using a factory method. Of course the very first thing I have to do is create a switch to decide what file encoding to choose. DANG!
Why doesn’t Haskell have type-level lambda abstractions?
Are there some theoretical reasons for that (like that the type checking or type inference would become undecidable), or practical reasons (too difficult to implement properly)?
Should database queries be abstracted out of the page itself?
When writing page generation in PHP, I often find myself writing a set of files littered with database queries. For example, I might have a query to fetch some data about a post directly from the database to display on a page, like this:
How flexible can hardware get? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for […]
How does strengthening of preconditions and weakening of postconditions violate Liskov substitution principle?
I read that Liskov’s substitution principle is violated if :
What kind of abstraction/SoC should I use here?
I am starting a new project, and I want to follow the separation of concerns pattern, and I have been reading on the topic, and now I am in doubt of how I should go about this.
Rules about the concreteness of method parameter types, return types and property types
Some time ago I read a kind of “rule of thumb” about the concreteness of method parameter types, return types and property types, but I just do not remember it.
Do frameworks put too much abstraction? [closed]
Closed 10 years ago.
What changes are too big to be made easy by proper design?
This is a rather vague question, but it’s something I’ve never felt has been answered in a satisfactory way when reading about proper design.
Using a DAO to abstract our ORM from the rest of the application
We’re using MySQL with Sequelize.js as the ORM.