My Headlines

Tuesday, April 17, 2007

Don's Handy Dandy Blend Developers Toolkit

by Don Burnett

I have been blogging a lot about Blend from the designer's point of view lately. I figured it's time I share with you the toolkit of must have utility program arsenals. I have also included a few Silverlight tools in here, just because I find them very helpful too..

Database Tools

If you are a designer or a developer that doesn't have Microsoft Windows development experience, but you may be a web developer who has done some ASP.NET/Database development the first wall you run into is the database. In ASP.NET you simply use a database connection string (dragging a database source onto the design surface and it sets it up for you and that's all you have to do.

If you are developing a Windows app in visual studio, you need to generate classes from the database so you can databind them to the CLR datasource (sometimes called the Object Data Source in Visual Studio). Now this is because most Windows applications divide things up into three layers, one called the data layer which handles all database access for you (efficiently), a Business layer which handles business rules for your data, and a model layer.

The first problem is generating the Data layer. Now the normal process is to go in and create these class by class using the XSD tool. I personally still find that a task of mortal drudgery. I would like a tool that goes in and does this all for me.

Is there anything out there? Well you are in luck there are two solutions..

CodeSmith Studio

This is the premiere code generation tool for creating multi-layer windows applications and it works from within Visual Studio. Now if you are a designer beware, if you get this tool it's like buying a Porsche. This product integrates with Visual Studio and let's just say if you are not used to working with a toolset or you are uncomfortable in Visual Studio you might get a little frustrated. It's more aimed at the professional developer. I am really hoping they create a version of this specifically for Expression Blend that creates classes automatically and lets you tie right into the CLR datasource in blend for that automagic databinding. Only time will tell.

SubSonic Zero Code DAL Layer

Don't need a Porsche but a Volkswagon would fit the bill? This is hardly a VW!  This tool was originally designed at users of ASP.NET who want to connect a database, and have it generate their own Data Access Layer with classes. To use this tool with Blend I basically go into Visual Studio with my completed database design (yes this supports MySQL, and other common database formats too in case you aren't a fan of SQL server), attach the database connection string, then include the subsonic DLL and wire up the web.config with all the necessary provider info. Then I run the batch class generator, and create the data layer classes using the generator. Next, I export the classes, and move them and the subsonic dll (which I have to reference) into my blend project and go.  Now this tool wasn't really designed to work directly with Blend but I find subsonic really easy to work with. I basically take the output from the batch class generator and adapt it to my needs.

Things subsonic does for you:

  • A Data Access Layer (DAL) builder that requires no code on your part, it builds itself at compile-time with a full object layer and strongly-typed collections
  • A complete utility toolset, complete with Rails-like scaffolding, migrations (DB Versioning), and code generators
  • A dynamic query tool, that lets you use SQL Server and the Enterprise Library without having to know SQL
  • An OR Mapper that extends to views and stored procedures so you're not locked into the OR/M thing

What SubSonic does for you:
  1. Trim hours from your DEV cycle. This not only happens because the code is generated for you initially, but it's also maintained by SubSonic whenever you change your database.
  2. Gives you the option to go full-tilt OR/M, or use SPs/Views. We don't want to tell you what to do, you already know best. We just want to help.
  3. Help your application build itself. With our generators (class, scaffold, and batch-class) your site can build itself in no time. The scaffolding will help you work with your data quickly.
  4. A solid foundation from which to extend. Get your project from idea to prototype in a fraction of the time. That's the strength of this project - using our starter kit you can have a sharp prototype up and running in the merest fraction of what it used to take.

Please note in a non web app you have to reference the subsonic dll and there is a nice help support forum for this tool.. The tricky part is just getting the web project and the web.config wired up so that you can use the class generator before exporting the code to your blend project from the temporary asp.net one.

Check out this support thread in their forums if you have trouble..  Non-Web Subsonic Project Support

There is a walk thru also at this site if you are having problems with it..

DevInstinct.com has the custom tool for integration of subsonic directly with Visual Studio you should download and try it out.

XAML Utilities

HTMLTOFLOW-  This utility lets you take HTML and convert it to well-formed XAML, so you can convert content from html to XAML/XML format..

XAMLSTRINGBUILDER for Silverlight (WPF/E)- This tool lets you encode a XAML text file into appropriate javascript string format so that you can pass XAML files into Silverlight so you can control interactivity and graphics..

No comments: