DOS on Dope: The last MVC web framework you'll ever need
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 DoD.CodePlex.com
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 DoD.CodePlex.
A full-featured web development framework with the smallest possible concept count.
Feedback welcome.
'Hüseyin' on Mon, 06 Sep 2010 07:36:12 GMT, sez: That editor with the blue background must be the new TextMate-killer for the PC :)
'Steven Nagy' on Mon, 06 Sep 2010 07:48:02 GMT, sez: Just when I thought you couldn't stoop any lower..
'lb' on Mon, 06 Sep 2010 08:01:31 GMT, sez: @Hüseyin -- I really wanted to demonstrate the use of Edlin too, but didn't find an excuse.
@Snagy -- my depths are infinite.
'Liam McLennan' on Mon, 06 Sep 2010 08:03:50 GMT, sez: I did not realise you had so much spare time. ;)
Porting all of my projects immediately...
'Matt' on Mon, 06 Sep 2010 09:17:25 GMT, sez: I salute you!
'Martin Mazur' on Mon, 06 Sep 2010 10:31:27 GMT, sez: I'm speechless!
'Terry Davis' on Mon, 06 Sep 2010 13:19:47 GMT, sez: Does that come with Windows Vista?
Way cool.
'Terry Davis' on Mon, 06 Sep 2010 13:22:05 GMT, sez: Department of defense knows it's shit. We gotta befuddle all our enemies.
'Void' on Mon, 06 Sep 2010 14:08:12 GMT, sez: Wait a second,... that wasn't joke ???
'k3rni' on Mon, 06 Sep 2010 15:41:43 GMT, sez: Brilliant! Too bad it doesn't run on real DOS with a TCP/IP stack (from Crynwr or whatever). Any plans to do so?
'Eris' on Mon, 06 Sep 2010 15:52:46 GMT, sez: Wow, I was like, "This is one of the funniest jokes I've seen in this particular niche," and then I was like, "Oh wait this is a thing that exists," and then I was all "Well damn."
'Anil Dash' on Mon, 06 Sep 2010 16:19:18 GMT, sez: Kept waiting to hear that you "favor convention over config.sys" and was heartbroken to see you omitted that promotion from your product page.
'Armand du Plessis' on Mon, 06 Sep 2010 16:24:37 GMT, sez: now if this can be ported to mac/*nix my life would be complete
'tunaslut' on Mon, 06 Sep 2010 16:28:04 GMT, sez: wow...just wow! only question i have is how well does that csv nosql thingy handle sharding?
'Goran' on Mon, 06 Sep 2010 17:20:08 GMT, sez: As always - I'm left in awe of your kung-fu :)
'Evan Carroll' on Mon, 06 Sep 2010 17:35:57 GMT, sez: The new shiny Haskell framework is Snap. And, I wonder if this works under wine.
'Ugur' on Mon, 06 Sep 2010 17:42:01 GMT, sez: awesome (:
'Eddie Jefferson' on Mon, 06 Sep 2010 18:30:27 GMT, sez: I JUST SHIT MY PANTS AND DONT KNOW WHAT TO DO!!!!!
'Ralf' on Mon, 06 Sep 2010 21:42:53 GMT, sez: After having learned about Cobol-On-Cogs (http://www.coboloncogs.org/INDEX.HTM) Iwas sure DoD was a joke. But this thing is living, right?
I wounder how long it will take until somebody comes up with an assembler version of a web framework. Webmonics maybe...
You're crazy, dude... ;)
'Joe KLemmer' on Mon, 06 Sep 2010 22:01:24 GMT, sez: Bravo! Bravo!
This is even better than the http server I ran across many years ago that was written in awk.
If I had the time and energy I'd port this to shell files. But, well, that sounds like work. :-)
'patfla' on Mon, 06 Sep 2010 22:10:50 GMT, sez: Who says programmers don't have a sense of humor.
And maybe I'll even try it out. Will this allow me to replace Django - and python?
Haskell on a 'Horse'? I'll have to go look that up.
'Richard Quadling' on Mon, 06 Sep 2010 22:15:50 GMT, sez: "Edlin". I just realised how old I am. Thanks a fucking lot!
'Lit mostki' on Mon, 06 Sep 2010 22:50:46 GMT, sez: CP/M port please?
'I can fix your joke' on Tue, 07 Sep 2010 02:43:09 GMT, sez: The "does it scale?" is the punchline and "is it secure?" is the setup, so you need to switch those two to make it funny.
'Joshua K' on Tue, 07 Sep 2010 05:38:13 GMT, sez: you have inspired me to begin work on SQL on Speed. I like DOS, but I'm no fan of SQL... you are giving DOS a bad rep, and I think we should focus our attention on the guilty party.
'iki' on Tue, 07 Sep 2010 05:50:49 GMT, sez: Awesome!
Porting to Apache+Dosemu :D
'Chankey' on Tue, 07 Sep 2010 07:21:47 GMT, sez: Nice :)
'Lck' on Tue, 07 Sep 2010 09:41:09 GMT, sez: This is awesome! :)
'Daniel Berg' on Tue, 07 Sep 2010 10:55:50 GMT, sez: Holy. Crap.
It's funny though!
'Maximus' on Tue, 07 Sep 2010 11:44:06 GMT, sez: Does it come with a TASM compiler for those really complex scripts?
'Marcelo Clerici' on Tue, 07 Sep 2010 14:15:57 GMT, sez: Wonderful! You are smoking the good one.
'Jerry The old Gray Mare' on Tue, 07 Sep 2010 14:25:05 GMT, sez: I laughed my ass off, then I opened a command window.....
'Super Jesus' on Tue, 07 Sep 2010 14:36:10 GMT, sez: "If you can't trust public visitors from the internet, who can you trust?"
Just brilliant. I need to get that tattooed on my cock.
'doowell' on Tue, 07 Sep 2010 15:27:37 GMT, sez: Outstanding. Can it host Windows?
'Russ' on Tue, 07 Sep 2010 17:01:10 GMT, sez: I don't like it...no .ini files for configuration
'Fernando' on Tue, 07 Sep 2010 18:19:04 GMT, sez: Freakin' hilarious. Loving the scalability summary.
'johnnytogo' on Wed, 08 Sep 2010 11:58:40 GMT, sez: http://www.coboloncogs.org/INDEX.HTM
'Architecture Astronaut' on Wed, 08 Sep 2010 12:54:26 GMT, sez: You absolutely need to package this for automatic remote installation so that this can be used for building DoD clouds with high ROI!!1
'Aaron M' on Wed, 08 Sep 2010 17:38:01 GMT, sez: I knew I was missing something with django.. DOS is where the action is
'Johnnytogo' on Wed, 08 Sep 2010 18:03:03 GMT, sez: http://www.coboloncogs.org/INDEX.HTM
'Anders' on Wed, 08 Sep 2010 20:33:27 GMT, sez: I'm just... speechless. Friggin awesome, dude!
'renard' on Fri, 10 Sep 2010 16:28:41 GMT, sez: code as satire, love it
'Nomar' on Mon, 13 Sep 2010 15:17:47 GMT, sez: Wait, long file names? That's cheating.
'viswanath' on Tue, 14 Sep 2010 11:53:52 GMT, sez: Hey i'm not able to see output when I'm trying it out on my PC. can any one help me????
'lb' on Tue, 14 Sep 2010 12:10:46 GMT, sez: @viswanath:
if you're trying it out and failing, give details in the discussion area at codeplex:
http://dod.codeplex.com/discussions
i'll be happy to respond there
lb
'Raj Chaudhuri' on Fri, 17 Sep 2010 16:10:44 GMT, sez: DUDE!
'jonno' on Tue, 21 Sep 2010 01:04:17 GMT, sez: I'll see your batchfile banditry and raise you an 8 bit BASIC bonanza :-)
http://lyonlabs.org/commodore/kb-bob/index.html
|