views:

110

answers:

2

A while back i read somewhere about how to improve upon the MVC pattern to accomodate the highly flexible and layered (web)applications we see today. (and to my frustration, i can't seem to find that article again)

For example, some of the Google applications like GMail or even a browser like Firefox.

It consists of components that can be extended and completely replaced. Users can choose the user interface or theme they like, has some kind of plugin system, etc etc...

Owkay I know, this is how big/great applications are build. That's why i ask this question.

Could you provide me with resources or insight in what patterns are used or how these applications are build architecturally...

+2  A: 

I guess you are talking about software architecture (in contrast to hardware or system architecture).

Possibly the most important rule (I wouldn't call it pattern) is seperation of concerns. Meaning one component should handle exactly one task, only that task and the complete task. If you stick to that (which is harder than it seems). You'll have the basis for the plugability you mentioned, e.g. exchanging the UI. If your UI layer really does only UI, it can be replaced by something completely different.

If you are really talking big, like the mentioned GMail the concept of 'eventually consistent' becomes important. Classical applications are structured in a way that the user performs an action, say pressing a button. The application processes that action (e.g. saving data from a form in a database). And refreshes the GUI when it is done (e.g. replacing the 'save' button with an edit button. This linear processing has the benefit, that the user always sees a consistent state. If he turns around and searches the database he'll find his data right there. But this doesn't scale to well, when you have extremely high load on the system, because the optimum database for saving, is most of the time not the perfect database for searching. So some application do something like this: When the user hits the save button, the store the data in the fastes way possible (e.g. a database optimised for updates), set a marker that further processing is needed and refresh the gui. Now a separate process comes along to process the saved data, e.g. by updating special indexes or by storing it in a separate database that is optimized for searching. This second process might gather changes for many actions in order to improve performance.

With this design you can scale further, because you are separating concerns: storing and searching data are two different tasks, so they are split in two different component, which can in this extrem case work in parallel. For the user this means he might not immediately find the stuff he just saved, but he eventually will. Hence 'eventual consistency'

Edit: I forgot about the resources. Great books about application architecture are: Martin Fowlers 'Patterns of Enterprise Application Architecture'. For Patterns in general of course: 'Design Patterns' for Patterns concerning Messaging Architecture 'http://www.amazon.de/s/ref=nb_ss_eb?__mk_de_DE=%C5M%C5Z%D5%D1&amp;url=search-alias%3Denglish-books&amp;field-keywords=Enterprise+Integration&amp;x=0&amp;y=0'. I can't recommend any books on scalability, but 'Building Scalable Web Sites' was recommended to me. The architecture of various big applications (e.g. Twitter) is a topic of talks, presentations and papers, so you'll get lots of resources when you google > architecture twitter <.

Jens Schauder
some good points and concepts there, i like the 'practical' examples... txn
Sander Versluys
i'm reading Fowlers 'Patterns of Enterprise Application Architecture' now, and it's really awesome!
Sander Versluys
+1  A: 

Model View Presenter (MVP), it is often confused with MVC, but I find it much more flexible, although it could possibly benefit from an additional controller component. I can't tell you if its more beneficial in large-scale applications, but its definitely a MVC-like pattern. Other MVC variants exist, such as the Model View ViewModel (MVVM), but that one's more specific to Microsoft's WPF.

Trillian