4 ms·
Composite is often a work around for poor support for delegation in the language; so too is Facade to some extent. The language feature that will make MVC obsol
by lmm 14y ago
Composite is often a work around for poor support for delegation in the language; so too is Facade to some extent. The language feature that will make MVC obsolete is less obvious, but I have confidence that one will arise.
>The truth is that modern OOP (even in Java) doesn't many of the patterns in the GoF book any longer.
Oh how I wish I shared your optimism. You still need Visitors and Factories and Singletons in Java, because the language still doesn't provide the features that replace them. At least with java 8 we'll finally be getting lambda.
- jrajav 14y agoIsn't MVC a specific case of "make your code modular"? I don't have as much confidence that I can imagine a language getting rid of that.
- lmm 14y agoIt is, but most patterns are like that to a certain extent. I'm not thinking of a language that eliminates MVC so much as one where MVC is so easy and natural that it's not even a concept that needs a name. (Just like passing a function as a parameter doesn't really replace the Command pattern, it just means it's so normal and obvious that you don't think of it as a pattern).
- jrajav 14y agoI'm not sure this discussion applies to MVC as easily as you're making out. It's a design pattern, not a code pattern. Let's make it more general, though. How would a language that "gets rid" of the problem of modular code look like? That is, a language that makes it natural to organize your code based on high-level functionality, responsibility, and/or dependency? It seems to me that such a language would have to bring in arbitrary limits and introduce a lot more problems than it would solve, assuming it's feasible at all. I'm not saying this is something I've given a lot of thought to, it just has a "concept smell" to me. There are cross-cutting concerns in software development that don't have an obvious technical solution. Modular code is one of them. There's no logical reason for us to organize code in such a roundabout way, it's only to help us measly humans reason about it more efficiently during the process of software development. So, there's unlikely to be a way to unproblematically translate that process into something logical.
- lmm 14y agoA lot of the reason for MVC is to avoid mixing business logic and data. So maybe one route to making it redundant is to have the language make more of a distinction between data objects and logic objects. Scala's case classes give you a slight nudge in this direction - after a while you become uneasy at seeing a complex function on a case class, or a non-case class with lots of data members - but it's quite subtle; maybe a future language could make it harder to do these two things. I think there's this constant tension in language design between giving you the power to do really cool things (python) and the constraints to stop you screwing up (java). But I think that more modern languages are getting further down the funnel, combining the advantages of both.
- Evbn 14y agoRails scaffolding provides a language (the rails comma done apps) that sets up MVC. Rails itself has code that follows the pattern. The code you write in your app doesn't follow the pattern, it fits into it.
- troels 14y agoWell, a Facade is very much about hiding away something that you have no control over. Even in an FP environment, you need to communicate with third parties, and they generally to a crap job of their api's.