Although it would be nice for this framework to support any UI I know that just isn’t practical. Anytime you find yourself thinking you have a solution for any problem that may arise you have a silver bullet and usually all that is good for is putting you out of your misery :)
The UI this will target initially is really focussed on the administration side of the websites built today. Most sites will have a decently large admin section especially if you’re writing a full web application. Since admin sites can be made to follow rules I think its a good place to start.
-c
Welcome to the first post for Uweni. Currently a research project for advanced UI generation in the ASP.NET space.
So before I try explain what the project does let me explain the problem – that will help you to understand what I’m trying to do and very importantly, are there other projects like this already? am I getting it all wrong? Feel free to leave me comments on either question! Thanks.
The problem is that developers just plain suck at graphical design and often at user interfaces in general. I write tons of code and I’ve built up some groovy frameworks over the many years I’ve been doing this. Recently due to work load I realized that I spend probably close to 80% of my development time working on the UI and that is just too unproductive. It’s ok when you’re working for a decent size development firm as they can absorb the inefficiencies but smaller teams or single developers definately cannot. The worst part is, even after spending so much time on layout, css and divs! and even with part of my masters in HCI the end site looked bad, at least to me. It may be acceptable but it just takes too much time.
Developers write code and that is all we should be doing. Let real designers do the rest. So you’re probably asking, why not use theming or templates? Good question but if you’ve done any of that work before you know you still have to create the aspx pages the server controls or client side html controls and so on. Even with perfect CSS design you can only change so much before the developer has to get involved in the design. Some systems do a good job of mixing code snippets (user controls) with CSS to allow a site to be 80% re-designed without the coder but I want 100%.
Imagine writing an application, web based in this initial work, where you as the developer never touch the UI. You create your code, give it rules and the system generates everything else – in real time, not code generation. I’m pushing for a model in which the generator itself can accept “designer friendly” templates to change everything UI related and if you don’t have access to a designer then the internal generation is clean and professional in appearance. Every time you create a new page, well you don’t – it may exist for the system to function but it simply kicks off UI generation.
I’m thinking along two lines for this. The first I don’t like because it would mean building your UI rules in markup. The second is more for the coder and stays clear of every thing else.
- So in this case we create the aspx page and add advanced server controls to the page. Let’s use the example of needing to generate some CRUD code for a database table. Our control would have attributes that define how to get the data (data binding) and what columns we’d like to bind coupled with rules for what happens to the controls on the UI side. Your page would look a lot like the usual aspx but I still think its a bit messy.
- Now in this case I need to figure out the details but lets for now just say the aspx page inherits from a base that accepts a new object during load to generate the UI. You create an object and using attributes you give it rules for the UI system, when you’re done just pass off this object and presto – the UI happens.
Of course I need to figure out the specifics of how this works – making sure of course that the usual page events still work. The rules I’ve set in place also dictate that 3rd party controls should also work – let’s take advantage of the great work done by companies like Telerik, ComponentArt and Devexpress.
Please feel free to contribute your ideas to this project. All comments are reviewed and you will be able to get builds of the generators from the Uweni page. I’ll post some code ideas later on this month to better explain my thinking. I’m also hoping for a release of the new MVC project from Microsoft soon – it would allow for easier integration of the generators into the view.
“Code Generation” tools to be more specific. Let me clarify that firstly. I’m not talking about tools that just take away programmer’s jobs – I don’t see anything that would suggest that is currently possible. I’m more interested in tools that just do what we keep repeating. If you haven’t discovered code productivity tools yet then you’ve been living under a rock! It’s time to wake up and get busy. You’re too slow these days without some good tools and so I’ve put a few posts together just for the best tools you could start with.
If you browse around the net these days you’ll find tons of “silver bullets” for the programming problems of today. Time is usually the best test of these things and pretty much all fancy styles, methodologies or techniques have failed or fail to some degree. The bottom line is, there isn’t a magic way to develop software, that will at least guarantee good quality or bug less code. So I think the next best thing is – how do we developer faster? and if we do find something that works well, how can I automate that so the next time I use it, a. I don’t have to rewrite it and b. I don’t re-create any bugs.
As a developer if you can build a library of tools, snippets and templates you’ll definately be headed down the road to more successful software. Now not all my suggestions are for code generation – I’ll talk a little about profilers and other such tools you just have to have!
http://www.typemismatch.com/2007/11/25/tools-productivity-tools-generators/
http://www.typemismatch.com/2007/11/24/tools-net-profilers/
If you do have any tool recommendations please leave a comment and I can see about adding a post for them.
-c
There are many tools out there for developers and I’ll probably write some more later about some ORM tools I use often and that save a ton of time. This article is about a more generic tool, something that can help you no matter what kind of code you’re writing. These are productivity tools and/or code generators.
A good tool in this area does at least the following:
- Helps identify code mistakes
- Supports code block templates
- Lots of refactoring support
- A good deal of syntax high lighting, i.e. code blocks, braces, line numbers etc.
Again this isn’t a tool you’re going to find for free. They take a great deal of time and research to develop so be prepared to spend a little. I’d say anything priced from $150-$250 is about average.
Below I have listed two tools both from the same company. The first called “Refactor!Pro” is a great tool however it is included in the more advanced product called “CodeRush” both from DevExpress.
Although Refactor!Pro is only $99 it is well worth the extra $150 to get the full product. This tool is incredible and you’ll discover even in the first day of usage that it can save you a ton of time. The ability to create your own templates which change depending on the code you’re editing is awesome. I picked this over competitive products primarily for 1. Their support and other product lines and 2. Their integration with the keyboard and keyboard shortcuts was just the easiest to use.
Don’t forget, you must learn to use these tools. If you get one and don’t bother to learn the shortcuts or how the templates work then you’re just wasting your money. See some juicy screen shots belows.

As usual you can get a nice long trial, so give it a go!
-c
This post is part of my series on development tools. There are way to many companies out there that do not offer their developers any tools what-so-ever and it is a real shame. If you’re a lone ranger then you need to get some cash and get these tools.
If you want to write high performance applications there are many things to consider and I’m not going to get into all the design aspects now. What I want to stress is that as human beings we just don’t have the capacity to predict everything our software is going to do when it runs. Using a profiler allows you to see exactly how your code is running and for web applications you can get a great idea where to optimize and also where to add caching.
Unfortunately there are no good free .NET code profilers out there but hey, very seldom is truely useful software just free :) The JetBrains and Red-Gate profilers are your best bet. I found the Ants profiler from Red-Gate to be the easiest to use and understand the output. Although JB’s profiler looks better, I went with more functional. The guys at RG are also easy to negotiate with so go bargin yourself a good price!
Here is the link for the Ants profiler, go give it a whirl. Screen shot below:

-c
I work with a lot of .NET developers and hey even some Java ones from time to time ;) We’ve all done some dumb things and we all write bugs but the following is a recurring issue I find and I wish I knew where people were learning this.
try
{
// do something bad
}
catch (Exception err)
{
throw(err);
}
If you aren’t going to do anything with an exception then why are you catching it? Make your code user friendly and actually try recover from whatever went wrong, if it’s completely unknown then log it and let the user know (if required) that something bad happened.
As for logging techniques when things do go wrong please don’t just dump it out to a log file. I’m lazy and I don’t need to go trawling around the drive looking and then searching through log files. Here is my recommended sequence to follow when trying to log application errors:
- For critical failures send an email but as with all logging, make sure you don’t end up in loops!
- Log next into either the server event logs (application log) or an internal log that the site/application admin can use. Of course this won’t work if you’re experiencing a database problem in which case go back to the event log.
- As the last resort log to the disk.
Since I write a ton of ecommerce style sites I have one fail-safe for all financial related errors – all the available data gets emailed to me so I can rebuild the required data for the user.
-c
I plan to write about some things you need to know about this release but right now just know that it is hitting the MSDN servers. No one is sure yet if the new MVC framework is bundled with this but if it is get ready for some goodies.
-c
Ok so I did finally snap with Verizon and headed straight over to my nearest AT&T store to get a nice shiny new blackberry. I decided to get the Curve primarily for the larger screen and although sure-type is really great on phones like the Pearl I find myself typing faster on the full keyboard.
The phone is extremely light to hold and has a great smooth surface. The screen is clear and reception is great. I’m not sure if it is the phone or just the GPRS network but my call quality is amazing compared to my previous provider. Life is to short to be stuck with yesterday’s technology! :) I installed google maps and have used that a ton already, it can even follow your position as you drive ;-)

I hope you’re still not using Visual Studio 2003, if you are you need to get another job :) I want to talk about the hidden powers of VS 2005. Every now and then we get a good blog posting from someone at MS with tips on how to increase performance or do this or that.
Has anyone ever seen a site or even a single book dedicated to the things we “need” to know about VS but don’t. The only books I can find are general “using vs” kind of books but nothing for the more advanced developer.
Maybe we should put our heads together and write one? I’m giving it some serious thought and might kick off a page on this blog for gathering tips and tricks and then compile that into a PDF for us all to use.
Feel free to post your best tips in the comments.
-c
I recently launched a new site off some old ideas I had. I decided that I didn’t have the time to engineer yet other typical site with logins, account management, features, features, features etc. I wanted to keep the barriers to usage extremely low – since my site was going to be radically different, why lets users leave because your site wasn’t fast enough. I guess this is more about a simple site rather than simple code – which is a whole other story!
This is a short study on what took to build Mafooku and what appears simple sometimes isn’t. Take a look at the site for reference: Mafooku – Top 10
I started off the usual way, lets get the basics done for any site. So here was the initial list of things I thought my site needed. I’ve broken each section down into the initial “bad” list and then the final “good” list.
- We’re posting products so we’re going to need an login to edit products.
- If you need a login you need registration.
- Now I needed password/account recovering pages.
- Product edit/save page.
Woah … look at that list. To post a single product the user must first register, remember yet “another” username and password, understand their account layout and finally try post a product. Many users would have given up already so I narrowed down the list to just
- Let the user post a product.
A single page, short sweet with limited fields and just one image. Everything you need to get a seller interested in your products. So that may have seemed easy enough but we have a problem now. How does a user edit or re-post a product or more importantly delete it if it isn’t relevant anymore?
You need some creative thinking for this. A user can remove their product because when it is posted they get an email with an encrypted link to disable the product. Since only they have that email it acts like an account. The same idea applies to editing or in my case – just re-posting with updated details.
So from my initial list, item 3 wasn’t ever needed. Item 4 was really just item 1 simplified for the user so no extra coding here. Item 2 again wasn’t needed. There are now no barriers to usage, the site will be faster and much easier to understand.
I applied the same to the actual product listings. Categories etc just get too big for users to really navigate and search, when done right, can help a lot – is it really simple? I decided for this site, no. If you can’t see what we have within 1 click (no typing!) then it isn’t simple enough. Hence the front page items and a list of the last 100 and nothing else.
The actually programming behind the scenes was a bit more complex with some advanced caching, plenty of security and encryption but still remained a small size code base because I never stuffed the site with un-needed features.
-c