Tag: ASP.NET
Spark view engine
If you’re interested in the new Microsoft MVC framework but you’re a little skeptical about going back to a classic ASP Tag Soup rendering system, you should check out the Spark View Engine.
It has a very interesting way of allowing you to write your view with some simple string replacements and also specialized tags that appear to be actual HTML. The general idea is basically the same but visual appeal is quite a bit better.
Here is an example:
<var names=“new [] {‘alpha’, ‘beta’, ‘gamma’}”/> <for each=“var name in names”> <test if=“name == ‘beta'”> <p>beta is my favorite.</p> <else/> <p>${name} is okay too I suppose. </test> </for> |
In this case your “foreach” loop appears to actually be part of the html. The code inside of the each attribute is compiled as C#. The system it uses is pretty straightforward and easy to understand which gives me a lot of confidence in it already.
I have been having problems getting NVelocity to work properly so I am going to try to use Spark as the default NBusiness code generation tool. We’ll see how intuitive it is to have this pseudo-html markup inside of code but I suspect this tool will work much better for NBusiness.
Jeff Perrin on Obscuring HTTP
I was reading an article by Jeff Perrin about how ASP.NET attempts to abstract web development and came across this phrase:
Now the first problem with Webforms is not that it’s an abstraction, or even that it’s a leaky one (they all are). The problem is that what Webforms attempts to abstract away is actually simpler than the abstraction!
The second “problem” with Webforms is that not very many people know the first problem. I know I didn’t, until I saw how Rails, Monorail, and other frameworks are able to work with the underlying model of the Web, while still being terribly simple to understand and develop on top of. Making it easier to program for the Web is a laudable goal, I’m just not so sure that abstracting the technology that it’s built on top of to the point where it’s unrecognizable is the way to go about doing it.
To me this rings very true. I have been following the progress of the Microsoft MVC framework a lot lately and I can’t tell you how excited about it I am. It will be a giant relief to finally be rid of postbacks and viewstates!
Upgrading to NBusiness 2.1
I finally spent some time last night updating this blog site. I still have a few things that I want to do but I got some of the big things out of the way. The first big one was upgrading to NBusiness v2.1, actually it was pretty easy to do but I wasn’t sure how it would work out.
For anyone out there running 2.0.1 and thinking about upgrading to 2.1 I’ll try to list some issues you are bound to encounter. The first one is the change from using the static CreateNew() method to using constructors. so if you have code like this:
Blog blog = Blog.CreateNew();
You will need to change it so that it looks like this:
Blog blog = new Blog();
Much better if you ask me! Also the old create new methods will still be generated but it will give you an obsolete error message so you can find and change them easily. You may also have to change references to NBusiness in your website, i had to alter a web.config file that had version information in it. Other than that I had to run the sql stored procedures it created on my new site to get it to work which is fine.
Also there is one big problem I encountered and that is that the scripts will generate sibling relationship tables and scripts and keys at the bottom of “complete.sql” not at the top with the rest of the tables! Which means if you try to run just the scripts be sure to search for ALL of the table drop/create scripts because I accidentally dropped my BlogsTopics tables when upgrading. Which turned out to be ok because I wanted to redo them anyway (I had too many useless topics) but it could have been really bad in a bigger site.
I’ll probably make NBusiness v2.1 available as the primary download on codeplex later today (you can get it right now from the planned release section).
The biggest new feature of NBusiness 2.1 is the ability to use some generated objects to create dynamic sql. So when you go to create custom fetch methods its much faster than the current system. The other features are listed on the download page.
You must be logged in to post a comment.