in a previous post i started to take a quick look at the new BLINQ bits released this week at teched. to recap, essentially the core functionality of BLINQ (i love saying that…they should have named it bling) is to generate a CRUD structure of code and asp.net pages for your data structure. the “inq” in BLINQ is because the code generated uses LINQ. okay, all that aside, let’s start taking a look.
BLINQ is a command-line tool. type BLINQ to see the options. for simplicity comparison sakes for rails, i chose the /noStyle option so it would generate the vanilla-plainjane-nofrills-whiteasmilk scaffold site on my pubs database. yes, i’m using pubs — it’s easy to relate to most and has a simple structure including some foreign key relationships, etc.
for those new to rails (ruby on rails), i’m not going to go through a tutorial, and if you don’t know/care what rails is, then move along, there is nothing to see here. if you know a bit, then here’s a little bit more info to help setup the comparison. after installing rails, you’ll be working with sql server (or sql server express – which is free). to work with sql server in ruby/rails you’ll need want an additional database library for ado to make things a bit easier. you can download it here and read more info about it.
ensure the file (ADO.rb) is located in your
once you have that and after you have generated your rails app go to your database.yml file and modify the configuration. for simplicity sake, i’m only using one configuration type (development) to make things easier, since i’m just experimenting anyway. here’s what my database.yml looks like:
after i have that, i’m ready to go. again for simplicity sake, i’m just using the authors table. so generate a model and a controller for author. here lies my first beef with rails when compared to BLINQ. in rails you have to generate all your scaffolds individually. unless i’m mistaken and there is an uber scaffold command, i like how BLINQ looks at all the data and generates them all for you. *however* it would be nice to specify params maybe…so that i could have utmost flexibility — default generate all, or add an argument option for me to specify the tables. anyhow, i digress…
then in your author controller, change it to scaffold:
class AuthorController < ApplicationController
once that is in place, and you start your WEBrick server, you should be able to browse to http://localhost:3000/author/ and get this:
and therein lies my love of rails scaffolding! a simple, single line in the controller and i have full access to all the features. rails is doing everything behind the scenes. a quick look at my application views folder will show no files…think httpmodule for you asp.netters. i wish BLINQ would implement this — an httpmodule/handler that would allow me to configure the scaffold and then do all the magic goop for me.
here’s my second disappointment with rails scaffolding …there is no default page…i like how BLINQ generates an index page for me so that i can go to the site and then pick the pages i need to play with. even though BLINQ does this for me though, when on a page (i.e., authors), there is no ‘back to index’ link at all…so i rely on the back button too much. now remember i stated earlier that i used the /noStyle option to generate my BLINQ bling. if i hadn’t, then BLINQ *does* generate a skin/theme for me which uses the asp.net menu control and on every page i can see the nav structure. it uses a master page. i think even in the /noStyle option, a master page with a nav structure would be helpful — but i guess /noStyle means “no style” .
okay, so we’ve gotten this going…are you sick of command lines yet?
now let’s look at the functionality of the rails scaffold…want to delete something?:
nice! a confirmation…no confirmation in BLINQ generated UI — that needs to change!
when editing in rails scaffold, it takes you to a singular details screen with an update/back.
in BLINQ, you have inline datagrid editing with update/cancel
damn it — give me a back link here! i have a default/index page, so give me a link back to it!
it should be important to note that i’m calling it rails scaffolding, but technically it is rails in combination with activerecord doing the ruby/rails magic here.
one thing that i think both suck at right now are two key things.
validation: it knows what is required, etc., so why not wire up some validation for me? instead i get goobly-guck error messages (note to our asp.net team: we should use the customErrors and make something nice in the generated page)
foreign key relationships: it doesn’t generate user friendly views of this. take the employees view (shown in BLINQ gen here):
the drop downs are the values of the relationships and don’t portray the user-friendly view of the data…rails generated code is no different. again, we know the relationship…let’s put some more magic in here to make it whiz-bang!
one thing to note is that BLINQ does get it a bit. look below where my cursor is:
there is a link created for titleauthors — which is the relationship on this authors table…so i can directly go to that location. in rails, this isn’t there…
paging: this is a quick one — in rails, it is ‘next page’ and ‘previous page’ (just look at some of the shots above) — so how many ‘next’ pages are there? using the gridview in asp.net gives us numeric paging — done.
one thing that rails understands is plurality. my table is actually called ‘authors’, but you’ll notice the model/controller/etc are authors — it ‘gets it’ and does everything for me (yes, people/person works too). BLINQ doesn’t necessarily have this problem because it is generating specific code for the tables…if the handler/module method was implemented, maybe that could be examined…but for now it is a ‘cool’ feature in rails — not earth shattering, but nice to know if you need it.
for where i think BLINQ misses right now is in some easy hits.
- where’s atlas? why not make all the pages zing with some atlas uber magic? how about an /async option on BLINQ.exe? the CRUD pages scream with pleading for some low-hanging atlas love.
- please put in a delete confirmation
- show me my index link
- linq — this is cool how it uses this…take a moment to examine the code generated…it is pretty fun to look at — the pages using objectdatasources to bind to linq objects…yummy.
anyhow, a quick examination of the two in a few minutes…there are pros and cons to how each generates the respective ‘scaffold’ for their technologies (i’m not arguing the merits of the actual technologies here, just comparing some like implementations of features).
after downloading blinq and the may linq ctp, i decided to give it a quick run.
first, the installer just kinda installs on you not telling you anything. blinq gets installed into c:\program files\microsoft asp.net\blinq.
if you thought there was a gui, nada (yet). it is command line baby!
so i ensured i had the trusty pubs database installed on my local instance of sql express 2005. then i went to town.
to scaffold a database, just do the following:
blinq /t:<yourdesiredoutputpath> /server:<yoursever> /database:<yourdb>
be sure not to type ‘bling’
there are some other options, but this will get you a scaffold site. specifically i did:
after that i opened the site in vs2005:
i then ran the site and got the following screens:
i ran through some of them and saw some errors with a blank pubs database, but you get the gist…it’s all there. try it on your own site/data!
i plan on digging deeper and doing a comparison of
Ruby Rails scaffolding, but i did notice that like ruby scaffolding, it does not automagically generate the foreign key references in the UI. another thing i would have liked to see is the option of *not* generating physical files — i like that about ruby rails scaffolding — kind of an httpmodule feel with the ability to generate physical templates…i’ll dig deeper.
want some bling bling for your asp.net? okay, how about some blinq?
what is blinq? well, it’s best described as a scaffolding tool for asp.net data. point it to your database and you’ll get some asp.net pages for CRUD on your data using LINQ.
check it out here: BLINQ
update: my first look
i’m a huge fan of the universal remote control…but not the ones that you point at eachother and “learn” the codes…i’m talking programmable. it used to be that hard-core home theater fanatics were the only ones that could get them, and they were RF controlled and had to be programmed by the pros.
they have a line of harmony remote controls that are programmed via the web/usb — very cool. you just enter your model number(s) of your device(s) and it configures the remote. you set certain activities (macros) so all you do is click one button ‘watch dvd’ and your tv turns on to the right input, the receiver turns on, and the dvd player turns on, etc. it is very slick. get a new device, just plug it back in and update.
i’ve had the harmony 659 for a while now and it has been great and reliable. recently i started building out my home theater ‘stuff’ and acquired a new tv and xbox 360. I figured with the xbox i’d use the harmony remote for xbox 360 and got it. it sucks. it looks cool, but sucks. it doesn’t control my cable box well for some reason and the numbers to change channels are just way too small. i’ve not been happy with it. but i was too lazy to return it in time, so i was stuck with it.
i finally couldn’t take it anymore, and went out and got the harmony 880.
sweet! i updated everything (i wish logitech would change their site so i could have one login and choose the remote i want to configure, but i guess they figure not too many people will have many universal remotes ). at any rate, it updated quickly and controlled everything beautifully — even the cable box. i’m as happy as a kid in a candy store. it’s even rechargeable so i don’t have to worry about batteries.
yeah, i thought about the 890 for the added bonus of RF control, but i couldn’t justify the extra dough for that feature alone — i don’t have any walls to penetrate, etc.
so, if you have a stack of remotes, stop whining and get yourself to a store that sells the harmony from logitech…you’ll be glad you did!