July 2005 - Posts

WinForms Designer integration with "Data Sources"

One of the cool demos that I saw when VS.NET 2005 was first being unveiled was the ability to go to the Data Sources window and drag a “data source” onto your Windows Form.  Once the “data source” is dropped onto the form the designer magically creates either a DataGridView or a “details form”.  Overall it’s pretty snazzy.  The one question I have is why, oh why, do the forms get dropped onto the form in alphabetic order?  When you’re designing your forms do you ever think that arranging the form elements alphabetically would be the way to go?

Since I do a lot of code generation the properties on my objects are usually in the same order that the columns in my database are in.  This results in properties being organized in some sort of priority.  If I have a employee, first name and last name, are probably towards the top.  I imagine you see where I’m going…

When I drag my data source onto my windows form I’d like the controls that correspond to the “properties” of my data source to be in the same order they’re in within the actual data source.  I don’t want them to be added in alphabetic order.

Windows Vista on my Toshiba M200?

So I’ve been thinking about installing Windows Vista Beta 1 on my Tablet.  I’m a little concerned that I’ll end up regretting it though.  Does anyone want to give it a try first and let me know how it goes

Windows Desktop Search Extensibility and ActiveType

I came across a post today that linked over to the Windows Desktop Search (WDS) Extensibility for Partners (Beta) website.  What would be really cool is if we could install Windows Desktop Search on a server and have it index a website, blog, or other web “property”.  I’m tempted to write a plugin to get WDS to index content from ActiveType.  Unfortunately I have a bunch of other stuff to work on before I can play with such things.  It’d be cool though.

O/R Mapping: Attributes vs. XML For Mapping

Jeff Perrin posted a response to my If Attributes are good enough for Indigo why aren't they good enough for O/R Mappers? entitled O/R Mapping: Attributes vs. XML for Mapping.  In the post he disputes some arguments made for XML Mapping.  If your interested in such things check it out.

Web Service Related Links

RPC/Literal and Freedom of Choice

http://msdn.microsoft.com/webservices/understanding/webservicebasics/default.aspx?pull=/library/en-us/dnwebsrv/html/rpc_literal.asp

What's New in Web Services Enhancements (WSE) 3.0

http://msdn.microsoft.com/webservices/default.aspx?pull=/library/en-us/dnwse/html/newwse3.asp

Web Service Performance

http://msdn.microsoft.com/vstudio/java/compare/webserviceperf/default.aspx

XML Performance

http://msdn.microsoft.com/vstudio/java/compare/xmlperf/default.aspx

WSContactFirst

http://www.thinktecture.com/Resources/Software/WSContractFirst/default.html

Don Box on ASMX and WSDL

http://pluralsight.com/blogs/dbox/archive/2004/11/21/3606.aspx

ActiveType CMS Screenshots

As I mentioned a couple of weeks ago I’m currently working on a .NET Content Management System called ActiveType.  My recent focus has been on creating a new UI for the administrative interface for ActiveType.  To help with this effort I contracted Encytpemedia to redesign the administration UI for the CMS.  I posted a couple small screen shots of the new UI within my “Encytemedia redesigns ActiveType (CMS)” post, but, since I’m now done with the implementation of the new look I wanted to provide additional screenshots for your viewing pleasure.

   

This is the screen where you manage the “channels” within a site.  I’m planning on rename this to “Category” or “Folder”, opinions?

A list screen, with a confirmation being displayed.  Also shows the “Quick Create” boxes that are within the app. 

 A page to view comments, and yes I need to add paging

 This shows the layout of the edit screens within ActiveType. 

 This is the first page that will be shown when logging into the admin.  Obviously the lorem ipsum will be replaced.  I have a couple sketches that outline what data and actions will be made available.  Anything that you’d like at your fingertips when first logging in?

  

This shows the inline toolbar that is displayed as you browse a site when logged in as a content author. 

After clicking “Edit Content” the content author is presented with inline editing capabilities of posts.  Each “page” is made up of a set of content which is plugged into “placeholder controls” that are placed on the template (aspx).

So what do you think?  Does it look like something you’d like to use?  If so drop me a comment or an email to be notified when a beta (alpha?) is available.

The images within this post are posted on Flickr (which reminds me that I’d like to a create a Flickr placeholder control) so you can view all the images in this post by browsing to my ActiveType set on Flickr.

Future of Scrum: Support for Parallel Pipelining of Sprints in Complex Projects

Jeff Sutherland has posted an “article” on the “Future of Scrum: Support for Parallel Pipelining of Sprints in Complex Projects”.  Sounds very interesting…

Scrum was invented to rapidly drive innovative new product to market. Six month releases
used to be a reasonable time from for an enterprise system. Now it is three months for a
major new release, one month for upgrades, and one week for maintenance releases. The
initial version of the Agile Scrum development process was designed to enhance
productivity and reduce time to market for new product. In this paper, one of the inventors
of Scrum goes back to Scrum basics, throws out preconceived notions, and designs
Advanced Scrum using multiple overlapping Sprints within the same Scrum teams
. This
methodology delivers increasing application functionality to market at a pace that
overwhelms competitors
. To capture dominant market share in 2005 requires a metaScrum
for release planning, variable length Sprints, overlapping Sprints for a single team, prestaging
Product Backlog, daily Scrum of Scrums meetings, and automation and integration
of Product Backlog and Sprint Backlog with real-time reporting. A practical example of
Advanced Scrum describes how mobile/wireless product teams implemented Scrum
process automation during 2000-2005. Administrative overhead for over 45 enterprise
product releases a year was less than 60 seconds a day per developer and less than 10
minutes a day for a Project Manager. While Advanced Scrum is not for the uninitiated, the
future of Scrum is still Scrum, just faster, better, and cooler
.

Agile, Top Down

Ron Jeffries posted an interesting article in response to a thread that I was following on the Scrum mailing list regarding implementing Agile from the top down.  The thread on the Scrum mailing list was describing many reasons why implementing Scrum from the top down won’t work.  The basics are that by implementing things from the top down all that ends up happening is people begin to adjust their daily routines to make sure it “looks” like they’re “doing Scrum”.  If people are just doing what’s necessary to make it look like their doing Scrum it won’t have the impact on your development efforts in the way you would hope.  Implementing any given methodology from the top down is asking for trouble unless it’s done properly.  Putting out a mandate that “we must do Scrum” isn’t the way to approach it.  As Ron outlines in his article, the focus should be on providing clear objectives and providing real support for meeting the objectives.  If the objectives line up with the values of “Agile” then you’ll most likely be pleasantly surprised with the outcome.  If on the other hand you lay down the law and say “you must do Scrum” you will have an organization that is good at pretending their doing Scrum, but that most likely isn’t what your after.

In summary go read Ron’s article, he says it better then I ever will

Domain Models and Pesistence

Paul Gielens has an interesting post on “Keeping the Domain Model free from Persistence Logic.”  Within the article he talks about using different patterns to help ensure persistence doesn’t creep into your domain model.  He also goes through the general architecture which he’s created to help ensure that a bidirectional relationship between his domain and persistence packages isn’t created. 

PS – you gotta love the name of his blog: 

another Endpoint to my thoughts

More on Validation in WinForms

As I was looking over the validation controls in Genghis I kept thinking that the ValidationSummary control that we have in ASP.NET was missing.   Michael Weinhardt has a series of articles on MSDN from last year that overviews how to create a ValidationSummary for WinForms.  I’m wondering why this hasn’t been incorporated into Genghis?  Anyway the articles are here:

Extending Windows Forms with a Custom Validation Component
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms03162004.asp

Extending Windows Forms with a Custom Validation Component, Part II
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms04202004.asp

Extending Windows Forms with a Custom Validation Component, Part III
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms05182004.asp

Recommendations for sending a fax in .NET

So one of the side projects I’m working on at the moment requires that I be able to send a fax from a .NET application.  Do any of my loyal readers have a recommendation for the best way to do this in .NET/C#?  I’ve seen a couple “email to fax” type services that look like a possibility but before giving up and going that route I figured I’d see if anyone has any recommendations or suggestions based on their experiences with such things.

Thanks!

Update: I should probably provide more context.  The application will reside on a web server and will periodically send faxes to various third parties fax machines.  So the application needs to be able to automatically send a fax to a arbitrary fax number when a certain event occurs (perhaps an order of some sort).

BackgroundWorker and Web Services

One of the nice additions to the framework in .NET 2.0 is the BackgroundWorker class.  When doing WinForms development having a class that makes it easy to do background processing is a good thing.  Don’t hang your GUI, use a seperate thread. 

To use a BackgroundWorker class you can do the following:

1. Instantiate a BackgroundWorker instance:

BackgroundWorker

myDataWorker = new BackgroundWorker();

2. Setup a DoWork delegate that does the work that you want to be done on the background thread. 

myDataWorker .DoWork += new DoWorkEventHandler(delegate(object o, DoWorkEventArgs workerEventArgs) {
    workerEventArgs.Result = new MyDataService().GetData();
});

3. Setup a RunWorkerCompleted delegate that handles updating your UI with the data recieved on the background thread.

myDataWorker .RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object o, RunWorkerCompletedEventArgs workerEventArgs) {
   CustomObject[] data = (CustomObject[]) workerEventArgs.Result;
   this.dataGridView.DataSource = data;
});

4. Run your worker by calling the RunWorkerAsync() method on your BackgroundWorker instance.

myDataWorker.RunWorkerAsync();

Hitting the High Notes

I believe strongly in “Joel’s theory” that you should hire the best software developers you can find when trying to build a great software company.  Sure you could save some cash by getting a couple of mediocre programmers, and by all means if your in the business of saving cash try that out.  If, however, your in the business of creating great software hire the best programmers you can find.  Hit the high notes!

 

How to hide the extra column added to a DataGridView

For some reason I  had a hard time finding out how to hide the leftmost column that is added to a DataGridView by default when you add it to a windows form.  I looked over all the properties and didn’t find anything that seemed to make sense.  A quick Google Groups search turned up the answer.

 this.dataGridView1.RowHeadersVisible = false;

I’m still not exactly sure what “RowHeaders” has to do with that “extra” column but regardless it does what I want it to!

The latest Architecture Journal is available

I’ve been enjoying the content in “The Architecture Journal”.  This month we have a couple more good topics which are related to some things I’m currently working on.

To AdWords or not to AdWords that is the question

I’ve been considering adding Google AdWords to my blog to help pay for the costs of running this site.  I’ve been holding off as I’m not sure I want to start going down that path.  On the one side I think I ought to go ahead with ads since most of my readers likely are reading through an aggregator.  Any opinions?

WS-Transfer and Indigo

Roman Kiss has an interesting article on WS-Transfer and Indigo over on Code Project.  I’ve just started to take a close look at Indigo and so far I’m really liking what I’ve seen.  Hopefully I’ll have more reasons to learn and post on Indigo in the coming months.

I like Longhorn better

This morning came the big announcement that Longhorn was getting an official name.  Enter Windows Vista!

I’m not really a fan, I like Windows Longhorn better

Update: Well that didn’t take long, I decided Windows Longhorn is really the lamer of the two.  The point is, I’m not real crazy about the new name.

Infragistics vs. DevExpress for WinForms components?

Does anyone have a strong opinion on either Infragistics or Develop Express Win Forms components?  They seem to have the most “features/components” for the price.  Other components under consideration are DotNetMagic and the DivElements (although they seem a little pricier).  Should I be considering others as well?

Code Samples for Programming Inidigo

Since the URL is so easy to remember I thought I’d drop myself a link to the code samples for Programming Indigo.  On top of providing me with a reminder to their location it provides everyone else with a link to some Indigo code that they can checkout!

http://www.microsoft.com/mspress/companion/0%2D7356%2D2151%2D9/

Anyone know what's shakin with NHibernate?

I’m still trying to decide on what O/R Mapper I’m going to support in ActiveType.  I’ve been playing with WilsonORMapper a good bit recently and have liked my experiences.  I want to make sure I give other mappers a test run as well before making the final decision.  One of the things that has me a little concerned about NHibernate is there doesn’t appear to be any active development going on.   I’d like the mapper I choose to support .NET 2.0 (mostly generics) which is why I was hoping some activity would be happening in the NHibernate source tree.

Does anyone know what’s up with NHibernate?  Who’s actively working on the project? Do they plan on supporting .NET 2.0?  If so when?

Validation in WinForms is Lame!

WinForms validation is lame!

Coming from a web world where we have RequiredFieldValidator, CompareValidator, RegularExpressionValidator, and etc. to the WinForms world where we have, um, what do we have again?  Oh right…we have that validating event on our controls?!?! 

Why hasn’t form validation been something that was important to the WinForms team?  One of the nicest features (that I now realize that I took for granted) in ASP.NET was the “robust” validation capabilities available.  You’d think the WinForms team would have incorporated something similar into an initial release, ok, well maybe not an initial release but definitely a 2.0 release, or not.

For those peeps in the audience who started in the Web Forms world with nice validation controls checkout the Genghis project to get your fill.  The Genghis project brings the RequiredFieldValidator, CompareValidator, CustomValidator, RangeValidator, and RegularExpressionValidator to WinForms….woot!  If only it could have been baked into .NET 2.0.  Oh well I suppose I should just be happy such a project exists.

Where are all the cool built in WinForms controls?

As I’ve said time and time again I’m just moving into the WinForms world from a couple years in the web world.  One of the things I was interested in checking out in WinForms 2.0 was all the new controls.  Thus far I’ve been mostly disappointed.  I guess I was hoping to get some of the functionality that can be seen in the controls from Crownwood Software, Divelements, and others.  I was hoping for easy to create expandable and collapsible panels (ala Outlook 2003 & Eyefinder), dockable windows (SandDock), and just overall snazziness right out of the box.  Part of my problem is likely that I haven’t come across the properties that I’m looking for on the new controls to get the look that I want, or perhaps my expectations where just too high?

ReSharper 2.0 EAP

Finally!

http://www.jetbrains.net/confluence/display/ReSharper/Download

Update: I’m currently uninstalling until a more stable release is available.  I got errors pretty continously after I installed it.

Services meet O/R Mapping

One of the items that is currently on my plate from an architectural standpoint is trying to decide how to architect our application around services yet still gain the advantages of an O/R Mapper to ensure we aren’t hand coding a ton of dynamic SQL (we need to support 3+ databases).  One of the difficulties in this is that if we’re designing our services correctly we’ll be doing so by modelling them in XSD or possible with the help of Indigo attributes.  It’s not likely that these messages will map directly to the “domain objects” that need to be persisted to the database.  Or is it?  The limited number of services and operations that we’ve “mapped out” thus far accept an object or a set of objects that match up pretty closely with our “domain”.  I anticipate additional services coming along that don’t follow this mold but I think there is the potential that a decent number of our services will expose operations that accept/return messages that are composed of domain objects.  This means we should be able to pull out a domain object and pass it along to our O/R Mapper for persistence untouched.  If we use an O/R Mapper that supports POCO objects then we shouldn’t have a lot to worry about with this approach as our POCO objects should be relatively easy to include in our messages.

I’d be interested in hearing the opinions of those on the Indigo team relating to this.  How do they anticipate the objects defining the contracts for their services fitting into the “persistence story” of applications? 

It's time to think about services

Over the past couple years I’ve done a fair amount of reading on web services, service oriented architecture and the like however I’ve never had the opportunity to work in an environment where I’ve needed to use that knowledge.  With my recent move I’m now in a place where understanding service orientation is going to be extremely important.  Over the course of the next several weeks, months, and years (?) expect me to increase the amount of “service talk” on this blog. 

I’m looking to put my thoughts and ideas regarding service orientation into words here so that I can keep a “log” of my journey as well as so I can get feedback, advice, and comments from those that come across my ramblings.

Let’s start by getting down on “paper” what this whole service orientation thing is all about.  I’ve been told that the following four tenets are all you need to know.

1. Boundaries are explicit

One of the primary differences between “remote objects” (think .NET Remoting) and service orientation is the fact that with service orientation we try to ensure that the boundaries between our system and our services is explicit.  There should be no question about where the boundary is and when it’s being crossed.  Services aren’t free of charge, it costs “money” to cross our service boundaries so we should ensure that when we use services we are making the choice to pay the toll.

2. Services are autonomous

The services within our overall system should be autonomous, meaning updating or changing one service should not impact our other services.  The services within our “system” should be deployed, managed, and versioned individually.

3. Services share schema and contract, not classes and types

This one’s been said enough that I don’t think I need to talk too much more about it.  XSD is your friend.  Use it to model the requests and responses that your service speak.  Use it to define the “types” that your services work with.  Use schemas and contracts not classes and types.  If your service can only be consumed by a .NET client chances are your not sharing schema and type.

4. Service compatibility is policy based.

Services need to agree on how they will interact.  A policy is what we use to define the capabilities and requirements for our service.  By defining our policy we allow other services to see the constraints and rules around accessing our services.  We also allow services to determine if their is a reduced set of capabilities that each can support.

As a disclaimer I’m currently reading Programming Indigo by David Pallman so although I’d like to try and pretend that I came up with all this myself I did just read his chapter of Service Orientation and used a couple of his bullet points as a guide as I wrote this post. 

 

 

Can I get a RemovingItem Event on the BindingSource object please?!?!

One of the nice things that .NET 2.0 brought us is a set of controls for handling the binding of objects to controls within our WinForm apps.  The BindingSource control and the BindingNavigator controls work with a DataGridView, as well as a Details Form.  The BindingNavigator control by default loads navigation controls for moving back, moving forward, moving to the first record, and moving to the last record.  It also allows you to Add an item and remove an item as long as your underlying data source supports such actions.

In a prototype I’m working on I want to set custom values on new objects when they’re added to the list, and remove items from the data store (aka database) that are deleted from the list.  Luckily I have a nice AddingNew event on the BindingSource control which allows me to setup the values that I need to when I click the “Add New” toolbar icon.  I quickly jumped to my code to add another event handler for when an item is removed from the list using the “Remove” toolbar icon, however, no such event exists!  I’m hoping I just missed some obvious other way which one can be notified when an item is removed from the list.  I am aware of the ListChanged event but the ListChangedEventArgs object passed doesn’t contain any reference to the item that was removed from the list.

Am I missing something?  Or am I correct in stating that the BindingSource control needs a RemovingItem event?

Slowly making the mental shift to generics (and Predicates)

One of the things that I think is fun about working with new technology is the process of making the mental shift necessary to really take advantage of the new technology.  Sometimes the “shift” is easy, sometimes not so much.  Today I started to see myself make a step towards the shift.  I have a list of items that I wanted to pull out a subset of.  My first implementation involved looping over each item in the collection, checking a condition, and if it was true adding it to another list that I returned from my method.

public List<MyItem> FindMyItems(MyItemSearchCriteria criteria) {

   List<MyItem> matches = new List<MyItem>();
  
   foreach (MyItem myItem in existingListOfMyItems) {
      if (myItem.Name.StartsWith(criteria.Name) {
        matches.Add(myItem);
      }
   }
   return matches;

}

Now since I’m using a generic List<T> I don’t have to go through the drudgery of looping over the collection, I can use the FindAll method and pass a predicate (delegate) like so.

public List<MyItem> FindMyItems(MyItemSearchCriteria criteria) {
    return existingListOfMyItems.FindAll(delegate(MyItem myItem) {
                   return myItem.Name.StartsWith(criteria.Name);
                }
             );
}

It’ll be nice when the “shift” is complete and I don’t have to re-write methods

Looking for examples of "Slick" UI's

As if I haven’t already said it enough, I’m working on a Smart Client.  One of the things that I think is lacking in the current version of the application is the slickness of the UI.  I’m looking for ideas of how we might pretty it up a bit.  What’s your favorite application to work with?  What application have you used recently that you really liked the overall UI of? 

Two of my favorites:

  • BlogJet – simplicity!
  • FeedDemon – Can’t wait to get more goodness in v1.6
  • Outlook 2003

I’d actually prefer to hear about more “business-type” [1] applications, it just so happens I don’t work with too many of those

What are some of your favorites?

[1] CRM, ERP, etc…

Generating code from Oracle with CodeSmith

I’ve been using CodeSmith for a while now in my development efforts.  Up until recently all my projects have been targetting a SQL Server database.  I’ve recently started a new gig where I’m working with Oracle as my primary database.  One of the biggest frustrations with this switch has been that CodeSmith seems to always bring back the table and column names in all UPPER CASE.  This leads to very ugly code!  I can update my templates to just upper case the first character and lower case all other letters but this doesn’t really give me what I want when a table or column name is TwoWords.  Someone HELP!?!?!

Web Services, .NET Remoting, or Both?

As I’ve mentioned several times now I’m getting ramped up to begin work on a Smart Client application.  One of the discussions that we’re currently having within our team is what “transport” we should support.  Initial conversations focused on Web Services, however, some recent discussions have brought up some performance problems in the current app which caused us to start considering .NET Remoting.  With all the Indigo talk recently it’s tough for one to decide which way to go with current applications.  We’ve heard over and over that ASMX have a clear migration path for Indigo and we’ve heard over and over that .NET Remoting does not have the same clear migration path.  Those of us stuck in a world where we have to actually build applications today and not wait for Indigo are stuck in a difficult position.  Do we go with Web Services so that a future version of our product is better able to migrate towards Indigo or do we consider .NET Remoting so that upon our initial release our customers get the most performant application?

Web Service Advantages:

  • Better migration path towards Indigo
  • Multi-platform
  • Support for WS-* Specifications for dealing with security, addressing, reliable messaging, etc.
  • Team has worked a with WS
  • Provides an extensibility and integration point for customers

.NET Remoting Advantages

  • Performance

As of now the only advantage I have for .NET Remoting is performance.  When it comes down to it I think we’ll need to investigate where the existing performance problems are in our application to determine if it’s worth going with .NET Remoting.

We have also considered a third approach which would include support for both WS and .NET Remoting.  Under this design we would develop service agents that would know how to perform the necessary actions using either WS or .NET Remoting.  This would give us the best of both worlds, however, would force us into taking additional time to develop for both.  We’d also be increasing the ramp up time for developers working on the application as they’d have to learn about both WS and .NET Remoting.

What else haven’t I considered?  In what direction would you go?