Karl Why Did You Write XAML Power Toys and What is Ocean?

In the last few days I’ve been getting questions about XAML Power Toys like; why did I write it; what was the motivation behind the work, etc?

I was actually beginning the UI development in my soon to be released Ocean Platform (details below) and found myself looking at creating 8 forms for Ocean’s metadata maintenance and code generation.

I was thinking, if I lay Ocean down for a week or two, I can write a tool that will allow me to author Ocean’s UI in no time at all.  Ocean has it’s own built-in advanced UI generation but Ocean is designed to consume metadata.  Since I didn’t have metadata yet, I needed to tool to help me author the UI forms. 

You see, I really didn’t want to hand type 8 more forms if I could get the computer to do it for me.  So because I’m lazy, XAML Power Toys was born.

Time

Time is one resource that can not be replaced.  It goes by so fast and seems to slip between our fingers very easily.  It’s vulnerable and somehow “things” inject themselves into our time.

As developers, we can (should) take steps to maximize our time.  We can maximize our time by having the correct tools, proven workflow and an understanding how to use these. 

We developers need to manufacture time by accomplishing tasks faster and with laser surgery accuracy.  In our world the goal is to deliver defect free, maintainable, standards based code.

The best way I know to meet this goal and to manufacture time is to generate as much production code as possible. 

This gives the developer more time to allocate to a better application design, to learn new patterns and to keep up with the flow of new technologies that can only be compared to the water flowing at Niagara Fall’s.  I wrote Ocean to give me time back.

Ocean

Back in May of 2008 I wrote this blog post:  Metadata – a Voice Crying in the Wilderness, Hey! I’m Over Here.  This was a call to architects to consume the warehouses of metadata that most projects have but do not ever get into the hands of the developers.  You say that’s not entirely true.  OK, then why do developers type ToolTip text into their forms?  Why is a developer typing XML comments on business objects? 

These are two over simplified examples of metadata that is located in a design document somewhere, but is not in a format or physical location that makes it easily consumable by the developer or a code generation product.  The term disparate data storage comes to mind.

I strongly agree with one of my mentors, Bill Jones that developers should own their code generation system.  We live in a very fast and volatile world.  Things simply change a lot.  Today’s architects and developers need full access to the code generation system’s data model, templates, template engine and generation code.  Yes, I know this will raise a few eyebrows, especially if your company provides Code Generation software.  But I wrote Ocean because I couldn’t find an off the shelf Code Generation product that did what I needed, was easy to understand, manage and had examples for VB.NET developers.

Right behind code generation an application of any size requires a set of libraries that sit on top of .NET that provide the services a Line of Business (LOB) application requires.

Ocean provides a light weight, comprehensive framework that works in WPF and Silverlight.  This was one of the requirements of Ocean, that it support Silverlight. 

Ocean is divided into five assemblies and I’ll be adding one more that is specific to Silverlight.  Below are some of the highlights of each assembly.

OceanFramework

  • Ocean is the UI for maintaining the metadata the Ocean Code Generator consumes.  It also makes calls to the OceanCodeGenerator to generate an object like a stored procedure, trigger, DAL, BLL, entity object or UI object.  I’m going to also add support to generate MVVM ViewModels.
  • OceanCodeGenerator is an ASP.NET web that runs in a secondary AppDomain under Ocean’s control.  This assembly takes a request from Ocean and generates an object.
  • OceanFramework is the code that runs in WPF and Silverlight.  It requires no code changes between the two platforms.  This assembly provides declarative validation on business entity objects, UI case correction and business entity base classes.  The validation is attribute based, but can also be declared in code.  Compiled, this library weights in at only 62KB.  For Silverlight, that is a real winner.
  • OceanFrameworkSQL is a light weight and super fast replacement for the DAAB I loved in .NET 1.1.  This library weights in at 29KB.  In addition to enabling single line of code database calls from your DAL, this library also has built in concurrency checking and object building from a DataReader or DataRow.  I’ve run tests and was able to build 19,000 unique objects per second using this library.  This is on par with LINQ To SQL and other object loading techniques.  Check out my three blog posts on Performance to review the test data.
  • OceanFrameworkWPF provides WPF specific code, commands, converters, UserControls and Custom Controls.  Most of this code is already on my blog.
  • OceanFrameworkSilverlight to be written soon.  Will provide Silverlight specific code and controls.

Ocean’s Workflow

Ocean does not claim or attempt to be all things to all developers.  It is not a silver bullet.  It’s a metadata driven LOB application development and maintenance tool.

Note that the Ocean libraries can be used without the code generation pieces.  You have probably noticed the XAML Power Toys uses the OceanFramework library.

My current workflow is:

  • Design the data model using SQL Server Tools
  • Sync Ocean with that database
  • Enter in all metadata for the application
  • Press a button and all the stored procedures, DAL, BLL and Entity objects are immediately generated
  • Easily generate additional required stored procedures, DAL, BLL and Entity objects for subsets of a class.  For example, the customer class has 25 properties.  The customer search results only has 5 properties.  Ocean allows you to create everything for this search results class in a split second and assists you with creating the DataTemplate for the UI.
  • Use Ocean to generate each UI object as the developer requires
  • Ocean handles changes to the data model and application requirements with ease by allowing some or all objects to be recreated on demand.

Closing

So on nights and weekends, I’m back to working on Ocean and hope to ship, including detailed documentation by the end of October or early November.  When released, Ocean will appear on Code Project and my blog. 

I’ll be presenting Ocean and doing walk through’s in the open spaces at the Fall Raleigh North Carolina Code Camp on 15 November.  Register if you’re in the area or can make the trip.

Have a great day.

Just a grain of sand on the worlds beaches.

3 Responses to “Karl Why Did You Write XAML Power Toys and What is Ocean?”

  1. daveker Says:

    Hello Karl
    I’m interested in how Ocean sets up UI screen navigation?

    Thanks
    Dave

    • Karl Shifflett Says:

      Dave,

      I’ve finished BBQ Shack and just need to write up some documentation and make some videos.

      I’m doing my very best to get BBQ Shack out next weekend.

      BBQ Shack uses the new Ocean UI controls You will love this control. Non-linear navigation with a single line of code. You can have a UI with stacks of model windows, it allows you to slide them off the screen, display another UI and then come back to the stack. Best code I’ve ever written.

      I’ve spend all my spare time upgrading XAML Power Toys to VS 2010 Beta2. When Beta2 is released, that will be my first blog post.

      Cheers,

      Karl

  2. daveker Says:

    Hello Karl
    Thanks for the update. I look forward to seeing it.

    Dave K

Leave a Reply

You must be logged in to post a comment.