DOS on Dope: The last MVC web framework you'll ever need

September 06, 2010

When you've done everything you can with Ruby On Rails....

When you've reached the limits of Haskell on a Horse...

If FubuMVC is not for you...

It's time to meet the MVC web framework to end all MVC Web frameworks.

DOS on DOPE is the modern MVC framework built on the awesome power of Batch scripts.

All of the controllers in DoD are batch files.

All of the views are batch files.

The model is based on batch files. The helper functions are... you guessed it! Beautiful batch files!

The complete source code and tutorials are available at github

With DosOnDope, it's this simple:

open a cmd window, and write:

dope site Blog

You just built a website, called 'blog'. Here it is:

Oops. It moves too fast, I can't keep up.

Here's all the folders that have been created for us...

C:\temp\blog>dir /s/a:d/b C:\temp\blog\Content C:\temp\blog\Controllers C:\temp\blog\h C:\temp\blog\Models C:\temp\blog\Scripts C:\temp\blog\Views C:\temp\blog\Controllers\Home C:\temp\blog\Views\Shared

And all the files...

C:\temp\blog>dir /s/a:-d/b C:\temp\blog\Default.aspx C:\temp\blog\favicon.ico C:\temp\blog\Global.asax C:\temp\blog\web.config C:\temp\blog\Content\Site.css C:\temp\blog\Content\li.png C:\temp\blog\Content\Logo.png C:\temp\blog\Controllers\_actionMissing.bat C:\temp\blog\Controllers\_controllerMissing.bat C:\temp\blog\Controllers\Home\Index.bat C:\temp\blog\h\a.bat C:\temp\blog\h\h1.bat C:\temp\blog\h\h2.bat C:\temp\blog\h\h3.bat C:\temp\blog\h\p.bat C:\temp\blog\Models\split.vbs C:\temp\blog\Views\Shared\_header.bat

Let's create a new controller action, and see how it looks.

Let's improve the look of that page. You type a little...

...hit refresh and see what changed.

It worked.

Notice the use of html helper methods like ' p.bat ' and use of the partial, ' _header.bat ' to give styling and a title to the page.

But websites don't live in a vacuum. We need some data to bring this thing to life.

In DoD we embrace the NoSQL movement and jump straight to the data-store of the future: a CSV file.

C:\temp>CD Blog\Models C:\temp\Blog\Models>copy con Posts.csv ID`Title`Article ^Z

Posts.csv is both the model that describes our data, and the store which will contain the data itself.

Let's generate actions for administering our Posts:

C:\temp\blog\Models>dope gen Post Generating actions for MODEL Post in Controller Home...

Check in a browser...

The generator has created a nice page for us, with a name and textbox for every field, so we can create new posts.

Once we've added a few articles, let's see what the index looks like:

If we look inside the posts.csv file, we see the data:

C:\temp\blog\Models>type Posts.csv ID`Title`Article 1`Hello Brazil!`Yes, yes, hello indeed! 2`Let's add a second for good measure`Oh yeah

Frequently Asked Questions

What about security?

If you can't trust public visitors from the internet, who can you trust? Executing user input as commands inside the operating system is the most direct way to get things done, and that's what matters most.

Does it scale?

So far I haven't run into any performance problems. Whenever I've opened up a DoD website to several users, my hard drive tends to get wiped long before I discover performance issues.

Well, that's about it. Source code and tutorials available at github / dos on dope

A full-featured web development framework with the smallest possible concept count.

Feedback welcome.

My book "Choose Your First Product" is available now.

It gives you 4 easy steps to find and validate a humble product idea.

Learn more.