Looking for great examples of MVC frameworks - model-view-controller

I've recently heavily gotten into Javascript programming. Currently I'm building a 'Fat client' powered by a PHP-based REST webservice.
This is going pretty well, but I want to learn more.. become an expert if you will.
My background is mostly MVC in PHP, so building true real-time GUI applications based on the MVC model is pretty new. MVC exists in PHP, but it's quite different. In javascript, because it's 'live' there's a much stronger emphasis for message-passing and events.
I'm learning based on the YUI3 and Backbone.js frameworks. I believe this is a solid foundation. I do feel though that, in order to become better I should try to learn from other (non-javascript) MVC systems.
I have some (very distant) memories of playing around with both Visual Basic and Delphi (6 and 7). Even though I'm sure these have solid frameworks behind them, there must be other frameworks out there that are great to learn from. I'd love to see a solid, non-javascript, lightweight framework or language I can learn from and borrow concepts from.
So my real question is: in the great history of GUI programming, what are some good examples of articles, books, or codebases I can read to strengthen my understanding of MVC, what has worked in the past and what has not, and how to create an elegant but powerful design.

Chapter 11 of Beautiful Architecture is about the MVC architecture in Emacs. Even if Emacs is not your cup of tea, it's still an interesting case study. An application that has been in active use and development for 24 years must be doing something right.

It cost a bit of money but the DoFactory stuff is great, I used it. Show how to implement enterprise level applications with MVC and a few other frameworks.
http://www.dofactory.com/products/products.aspx

Related

Lisp - Is it good for web programming/applications (interactive) ? The way ruby is ? The way php is?

Is Lisp good for web programming/applications (interactive), the way ruby and php are?
Things to take into consideration would be:
Ease of use
Deployability
Difficulty (especially for a beginner to programming)
(Edit)
I was Particularly referring to Common Lisp, after reading Paul Graham's essay. Would be my first programming language. In this regard. Is it suitable to do so ?
I hear that Clojure's macro functionality is not as powerful as Common Lisp's, and that's why I'm trying to learn Clojure. It teaches programming and is very powerful.
Lisp is a language family, not a single language. To somewhat answer your question, yes, web frameworks exist for the various Lisp dialects, like UnCommon Web for Common Lisp and PLT Racket (a Scheme dialect) has a tutorial on their web site too:
http://docs.racket-lang.org/continue/
But one Lisp dialect where you'll see quite a lot of web development going on at the moment is Clojure, since it can leverage existing Java libraries and infrastructure. Here's a list of projects, and that's not comprehensive:
Hiccup - represent HTML in Clojure
Ring - a HTTP abstraction similar to Rack in Ruby
Enlive - selector based templating and more
ClojureQL - a SQL integration library
CongoMongo - a wrapper for MongoDB
There'd be many more, but I think you get the idea. As for Clojure web apps in the wild, the Clojure learning site 4Clojure would be an example and you can check out the source code on GitHub (I occasionally contribute to this):
https://www.4clojure.com/
https://github.com/dbyrne/4clojure
As you can see there's quite a lot going on in terms of Clojure and web development. It may not always be smooth sailing, but people are working fast at making the experience better. Making use of existing Java infrastructure does have its benefits, like the possibility to deploy to Google App Engine etc.:
http://www.infoq.com/articles/deadline-clojure-appengine
Hope that somewhat answers your question...
I have almost no experience with PHP or Ruby. However, I can say that it is quite easy to write a web application using Hunchentoot, CL-WHO, and one of the many database backends (Postmodern, CL-SQLite, CLSQL, or even a simple serialization library like USerial or Rucksack).
There are also frameworks like Uncommon Web or Weblocks, but I have not tried them yet.
There's a funny quote from Kent Pitman
"...Please don't assume Lisp is only useful for Animation and Graphics, AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor applications, Expert Systems, Finance, Intelligent Agents, Knowledge Management, Mechanical CAD, Modeling and Simulation, Natural Language, Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web Authoring just because these are the only things they happened to list."
And, look, "web authoring" even made it on the list!
Lisp is good for web programming because it is so flexible and the s-expressions that make up Lisp forms have some nice similarities to HTML. To see what I mean, check out Lisp for the Web. Notice how he writes a macro to basically create a domain-specific language for creating web pages -- instead of defining functions, he's now defining pages! This DSL concept is also apparent in the CL-WHO library he's using, which lets you write Lisp that turns into HTML.
Paul Graham had success rolling his own solution while creating what later became Yahoo! Store in Common Lisp (and even more success writing about it afterwards), and since then many packages have sprung up.
Weblocks is the Common Lisp web framework that seems to me to have the most momentum at the moment. There's a video of it being discussed at the Twin Cities Lisp user group. UCW is very similar, but I don't see much action on it now (please excuse me if I'm just looking in the wrong places). The blog post on why the creator made Weblocks is pretty enlightening: he basically wrote enough Lisp so that he'd never have to deal with HTML, AJAX, and JavaScript again. That might be an overstatement, but the fact that he could even do some of that should answer your question.
This is opinionated but so is the nature of the question, so here's my take.
I would not recommend a beginner to programming to start with a functional language, especially a Lisp.
T concepts on functional languages and especially Clojure are more advanced and the power it gives you, you propably won't need in your first steps into web development.
So since you are a beginner, then my answer would be no, Lisps are not as easy to learn and use as Ruby and PHP are.
For web application, framework is important consideration than language. If language is very powerful but don't have good web framework, developing web application immediately become hard and face lot of known complexity.
Think about ruby without rail framework, people start to like it because of rail framework. This is same as java, using only Servlet without Jsp or other framework developing web application will be horrible.
Now come to your point, easy of use always relative- I could not find any end to end framework in LISP family like ruby or python. But I found Clojure reduce lot of complexity in server side. Deployment- it depends on server, not language like java server need war or ear file. Learning- it is also relative but tools some times help like debugging or ide. But most of the lisp family don't have good debugging option.

GUI: Decoupled view and design patterns for RIA

I made some GUI desktop applications on my first years of development, but my experience and practice have changed, so now I'd like to retake this subject with better knowledge.
Most of my experience has been web since then.
I've been reading about GUI Architectures, and several related questions here on S.O.. I know I'm still not in the "architect" level of knowledge from Design patterns and such, as to start building a great GUI App from scratch
I'm trying to figure out how to design an app with a GUI, using good design practices for the architecture. I'm focusing on MVC architectures, with RIAs (Flex, Java FX, you choose), thinking of keeping the GUI as decoupled as possible from the domain. This has brought me some trouble...
I've been having a hard time relating an MVC architecture such as SpringMVC with a GUI, which could also implement its own MVC. Most of what I've read are high level concepts, but I can't seem to be able to translate this into code.
"Where do I create the view?", "How do you hook the controller with the model and the view?", etc. These are some of the questions I keep asking myself after some reading and studying.
I'm probably kind of lost, and quite entangled as to where to start, so any help is appreciated.
Are there any guides/tutorials/documentation you can recommend to start on this subject? I should probably start with the RIA/GUI basics, and then specialize on the technology I'll use.
You didn't specify which language you prefer, but here are some practical guides for Java:
Java SE Application Design With MVC:
http://www.oracle.com/technetwork/articles/javase/mvc-136693.html
Model-View-Controller (MVC) Structure
http://leepoint.net/notes-java/GUI/structure/40mvc.html
Also, for specifically SpringMVC, here are some practical guides:
http://maestric.com/doc/java/spring
http://www.zabada.com/tutorials/spring-mvc-basics.php

Picking a ColdFusion MVC Framework [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am taking over a lot of the ColdFusion stuff that is lingering at our shop and they are insistent it stay on ColdFusion and that new projects in this area MUST be done in CF - basically this part is non-negotiable. I am not very experienced in CF (haven't touched it since 2003) so most of my development has been in .Net, MVC, C#, Linq-to-SQL in the past 4-5 years.
I was doing some looking around for a MVC framework that I could relate my Asp.Net MVC experience to and hopefully an integrated ORM (I am stuck using CF 8 at least for a while). I have found a few like Model-and-glue, Mach II and Coldbox etc. but I don't really know where to start and wanted to get some opinions on the advantages, disadvantages, etc. of each of them from people who use them.
I know that I will need to do an extensive brushing-up (pretty much re-learning) of CFML, so I don't need to be told that - I am looking into the future here.
Could you please share any information you have on CF MVC Frameworks to help me choose which one will be best for me? Thank you.
Seeing you are NEW to ColdFusion what I would do is pick ONE FRAMEWORK and stick to it. At first it will be hard you will have problems and you will be tempted to drop the Framework you have chosen but don't do it. After you have mastered one framework then you can learn the others.
CF Wheels
ColdBox * * * (Nice Documentation)
FarCry
Framework/1 * * (simple LIGHT framework)
FuseBox
ModelGlue
Mach-II
Most of these you can add
ColdSpring
Reactor
Transfer
An introduction to ColdFusion frameworks at Adobe.com
Most important is to remember we all have our opinions but there is NO real proof what is best. You can even NOT use a actual framework and just code carefully in MVC.
The stuff you are currently maintaining
I would pick ColdBox, ModelGlue or Framework/1.
ColdBox provides a little Code Generation and Framework/1 is very light so less to learn.
I've been using CFWheels for a couple of years and I've not found a better framework. It's inspired by Ruby on Rails and is very easy to learn with great docs and a very active community.
www.cfwheels.org
I teach a course in ColdFusion and use Sean Corfield's Framework/1 in the classroom. It's lightweight and has a very gentle learning curve, which makes it especially good for transitioning existing codebases. But at the same time, it's easy for a team of developers to work with and can scale to large apps. It's the framework that feels least like a framework and most like natural code, to me anyway.
http://github.com/seancorfield/fw1/
I wanted to give a +1 for cfwheels.
Since 2003, I've used Mach II, ColdBox, Fusebox, and Model-Glue for various projects. All had their pros and cons (Fusebox is the only one I'd avoid now) but, with a recent project, I decided to try CFWheels.
Using Wheels has been a blast. I've had a great time developing a site for some friends in my small town who own and operate an Ice Climbing and Guiding site ([www.ourayclimbing.com]). Nice SES URLs, runs great on Adobe CF and Railo, the admin was insanely easy to get going with the Scaffolding plugin, convention over configuration (which I love :)), etc.
In any case, if you stick with the major players (ColdBox, CFWheels, Mach II or Model-Glue), I think you'll be pleasantly surprised at what CF can offer you.
It has to be coldbox really.
It has excellent documentation on the site, and also has a book which has been brilliantly written to cover many aspects about object orientated programming, amongst other topics. Honestly, really impressed by the book, more than I was expecting.
What I like about the framework is that it uses coldfusion code in its handlers, when I picked it up I think the other frameworks where using xml...not sure if this has changed.
The framework is easy to pick up if you are knowledgeable on CFCs, and has several useful features for building sites. PLugins, Debug toolbar, URL rooting for "pretty URLS"..
I cant speak highly enough of the framework..
Theres also a really helpful community here who respond to all my questions really promptly.
I'd suggest checking out Mach-II. It's used on numerous extremely high-profile, high-traffic sites and has been for years. This blog post is a bit old at this point but still has some great info in it in terms of Mach-II in general as well as who uses Mach-II.
It's under very active development (don't let the lower version numbers compared with other frameworks fool you) with version 1.9 just around the corner and big plans for 2.0.
Big features of Mach-II include sophisticated caching and logging functionality, a very nice dashboard for helping with development and monitoring of your applications, a rich form tag library complete with data binding, and tons more.
I'd go with either CFWheels or FW/1. Both are very easy to use for those new to CF frameworks (I still count myself in that group) and don't have nearly as steep a learning curve as some others. Coldbox looks amazingly powerful, but I had a hard time getting my head around it.
You might also like my SOS and COOP frameworks. We are in the process of creating better public docs. It will likely be more like the code you are used to than other options.
You could also look at ColdBox. http://www.coldbox.org/
Loads of documentation and loads of features.
There's also Farcry Core Framework http://www.farcrycore.org/
It has to be said that you'll need to make your own mind up which framework you like best or whether to build one of your own. It really depends on what you want out of the framework.
In terms of ORM for ColdFusion 8 you have Transfer ORM (http://www.transfer-orm.com) and Reactor (http://www.reactorframework.org/)
Though, given that ColdFusion is java application on top of a java server, there is no reason why you couldn't go ahead and use Hibernate (http://www.hibernate.org/) ColdFusion 9 does make using hibernate much easier, but you're stuck on 8 for the moment.
Everything is negotiable. Rewriting the CF apps in Rails 3 would be the strongest approach.
Languages and frameworks built on principles - Ruby/Rails 3 (and other Ruby frameworks), Python/Django 1.2 (and other Python frameworks), ASP.NET MVC 2 - are generally speaking the best thing to use.
ColdFusion and ColdFusion frameworks do not compare because ColdFusion as a language and as a library is hacked together at random and the ColdFusion frameworks (ColdBox, FW/1, Model-Glue, CFWheels, Mach II) can only do so much to smooth that over. For example: CF scopes, lack of closures, lack of loadable classes/components (you can instantiate a component, but not load the component as such), awkward arguments handling, mappings, lack of real applications, lack of delegates and closures, and convenient but non-rigorous approaches to most aspects of the language and library. In comparison, the other languages listed offer rigor plus sugar atop the rigor.

Required language, tools and approach for a scalable web application like twitter

Incase if you are to develop twitter today what language, tools and approach will one take. How will he start from the very frugal configuration and gradually scale to the levels twitter has reached today. Incase if you can provide direct responses like (PHP+ Apache+ memchached+ MySQL) or (JSP+TomCat/Glassfish+ MySQL / other db) etc.
The criteria is an architecture which scales easily without much engineering and the right language so that one doesnt need to rethink his decision once the same is in place.
(As far as I know, Twitter is RoR, Linked in is Java and Digg in Php. So not looking for just random thoughts :) ) Do support why do you think your option should suffice.
Thanks
As you already say it, there are several applications that shows that several technologies are able to scale. Fortunately for them.
I think you should not focus only on "is this technology the best for scaling". But on the two following points :
Do you have skills in that technology ?
Is that technology adapted (by it's philosophy) to that application ?
Scaling is a thing. But if you can't develop your application with the "killer" technology because you don't understand it, it's anyway useless.
I recommend looking at the High Scalability website. You can build a scalable web app in virtually any language, but it's not just a matter of using the right technology and then plugging it in. You have to know what you're doing, no matter what technology you use!
Twitter was developed using the framework Ruby on Rails (ROR), and that seems to be a good choice. Ruby on rails is database agnostic (supports most databases), very scalable and very good for developing web applications quickly.
Cake is a popular alternative for PHP I haven't used Cake but hear it is very similar. The alternative to these open source alternatives would be a full blow enterprise environment like the microsoft .NET frameweork.

Where is a good place to start programming GUIs for windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have experience writing console and network client/server applications in C and C++, but I know next to nothing about using the win32 visual API, MFC, Qt, wxWidgets, etc. Where is a good place to start, and what method should I specialize in, so as to be future ready and robust?
This is a rather broad question, as programming GUI applications in Windows can be done in so many ways.
There are two main parts to developing any GUI app: the language and the API/framework. Considering you're interested in learning to build Windows GUI apps, the language isn't really a point of focus for you. Hence, you should pick a language you already know and work with a framework or API that can be harnessed by your chosen language.
If you want to use C you're pretty much restricted to dealing with the Win32 API yourself, in which case reading Petzold or Richter would be great places to start. The Win32 API can be quite daunting, but it's well worth the effort to learn (imho). There are plenty of tutorials on Win32 on the web, and there's always MSDN, with a complete reference/guide to the Win32 API. Make sure you cover not just the API, but other areas such as resources/dialogs as they are building blocks for your Win32 application.
If you want to use C++ you have all of the options that you have when using C plus a few others. I'd recommend going with the Win32 API directly, and then moving on to a known framework such as MFC, Qt, wxWindows or GTK so that you can spend less time working with boilerplate code and instead focus on writing your application logic. The last 3 options I just listed have the added benefit of being cross-platform, so you don't have to worry too much about platform-specific issues. Given that you said you want to work with Windows, I'll assume you're keen to focus on that rather than cross-platform -- so go with MFC, but spend some time with the Win32 API first to get familiar with some of the concepts.
When dealing with MFC and the Win32 API, it's a good idea to try and get a solid understanding of the terminology prior to writing code. For example, you need to understand what the message pump is, and how it works. You need to know about concepts such as "owner-drawn controls", and subclassing. When you understand these things (and more), you'll find it easier to work with MFC because it uses similar terminology in its class interfaces (eg. you need to know what "translate messages" means before you can understand how and when to use PreTranslateMessage).
You could also use Managed C++ to write .NET GUI applications, but I've read in a few places that Managed C++ wasn't really intended to be used in this manner. Instead it should be used as a gateway between native/unmanaged code and managed code. If you're using .NET it's best to use a .NET language such as VB.NET or C# to build your GUIs.
So if you are going to use .NET, you currently have the choice of the WinForms library, or WPF. I personally feel that you'd be wasting time learning to build WinForms applications given that WPF is designed to replace it. Over time WPF will become more prevelant and Winforms will most likely die off. WPF has a much richer API set, and doesn't suffer from many of the limitations that Winforms does. If you do choose this route, however, you'll no doubt have to learn XAML, which is a markup language that drives WPF applications. This technology is coming of age, and there are many great places to learn about it. First, there are sites such as LearnWPF, and DrWPF which have some really great articles. Secondly, there are plenty of quality books on the topic.
So, to sum up, once you've picked your language and tech, the path is actually quite easy. Just pick up a book or two, read some blogs, get into some code samples.. and most importantly ... write code. Keep writing, keep making mistakes, and keep learning from them.
As a final note...
In other words, Silverlight. If you don't want to go the MS route you might give Adobe's Flash/Flex a look see. Both Silverlight and Flash/Flex build RIA's. Which I think is where we are headed. They days of Office like apps are numbered
I don't agree at all. Silverlight is not the same as WPF. Silverlight is web-specific, and only has a subset of WPF's features. Given that the question asks for Windows GUI apps, Flash/Flex Rich Internet Apps are not really a fitting suggestion. I also don't agree that the days of Rich Client Applications (such as office) are numbered at all.
I hope that helps. Good luck :)
I don't know if I'd call it a good place to start, but if you want to be future ready, take a look at the windows presentation foundation which is built entirely for the purpose of programming GUI's for windows
My first experience writing simple GUI applications for Windows was with C# and Visual Studio. The GUI-building interface is a simple drag and drop deal that generates skeleton methods based on potential user actions. I only did fairly basic programming with this, but I imagine it would be an excellent place to start to learn the basics and extend into the more advanced capabilities as you go.
There are plenty of online Win32 tutorials:
http://www.zeusedit.com/forum/viewtopic.php?t=1218
There are plenty of compilers to choose from:
http://www.zeusedit.com/forum/viewtopic.php?t=238
I would also recommend getting the Borland Win32 SDK documentation in WinHelp file format:
http://www.zeusedit.com/forum/viewtopic.php?t=7
It only covers the bare basics of the Win32, but when starting, this can be helpful as it is less daunting and less bloated than the MSDN.
I'd never go down the Silverlight, Flash/Flex or any similar route. It does look nice, but the main problem is that the code of the engine that runs it is completely closed-box and controlled by a single company. Take, for example 64bit versions of both of those. If some new platform emerges, you won't be able to migrate your existing code to it.
For business apps, Windows Forms is very mature. It provides a gentle path from auto-generating a lot for you into allowing fine-grained control and rolling your own. There are tons of high-quality third party controls and a large body of examples, docs, etc out there. It's hard to run into a problem that someone else hasn't solved. I highly recommend acquiring some background Win32 knowledge (e.g. Petzold) as the WinForms framework lives on top of it.
I have no WPF experience, but from the sample apps I've seen it looks like a good choice for apps whose interfaces would benefit from more graphical metaphors. So if you're doing a banking app, probably not worth the extra design overhead. But if you're doing, say, a warehouse management app it could be improved by dropping pretty boxes into pretty bins.
#StephenCox: wrong answer to the wrong question. OP is asking about desktop client apps, and moreover, WPF != Silverlight.
For a simple starting point to get your head around the "event-driven" nature basically all frameworks are created around look at FLTK.
Here are some quick starting videos Link
For professional use I'd recommend Qt, expensive but often worth it in commercial situations.
Since you are already familiar with C and C++ I would recommend learning how to write a simple Windows GUI app using Charles Petzold's book. It will give you the fundamental understanding of how Windows works. It's good to understand that most everything that you see is a window (a button is a window for example) and that these windows respond to messages. I wouldnt' spend a lot of time on this though and you don't necessarily need to do this first if you are going to chose WPF. I just think it's good to have a basic understanding of this.
There was a good podcast recently on .Net Rocks called "Kate Gregory Develops in C++ for Vista!" on there she recommends that someone starting out now should not use/learn MFC (even though it has been recently updated).
As far as getting ready for the future you need to learn WPF, but it isn't complete yet, so depending on the kinds of client side apps you want to create, you will probably need to learn WinForms. The majority of people aren't using WPF yet, so it's a good time to start learning. I think you will find it easier using C# to learn it instead of doing managed code with C++.
Get your basics right first. Best tutorial I've found is: http://winprog.org/tutorial/start.html
After that, although the homepage is hatefully distasteful, the tutorial pages are good in content and aesthetics: http://www.tenouk.com/cplusmfcdotnet.html
Then of course there's MSDN.

Resources