CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Raymond Lewallen

Framework Design, Agile Coach, President Oklahoma City Developers Group, Microsoft MVP C#, TDD, Continuous Integration, Patterns and Practices, Domain Driven Design, Speaker, VB.Net, C# and Sql Server

Class designer is leaving something to be desired - data persistence.

I’m sure most .Net developers have played around with the class designer some at this point.  Its a great tool for visualizing class structures, interfaces, implementations and relationships, as well as creating new classes.  Personally, I’m still a “type it out” kind of person.  I guess I’m just a masochist in that way, but I enjoy it.

Here’s what the class designer looks like, for those of you who are behind the times:

Class Designer

But here’s the beef I have with it.  No disconnected persistence model.  That also just happens to be the same issue I have always had with the Sql Server diagramming tool.  In my opinion, the class designer is not really a designer, its more of a real-time implementor.  If you make changes to the class designer view, its going to make changes to your actual code in your project.

I would much rather have a true designer that lets me play around with the classes and interfaces, try a couple of different ideas and patterns as I rumble through the logic in my head, and then later commit those changes to the actual project.  It also would more easily allow for 3rd party vendors to create some cool tools to use the same persisted data on disk to do some cool things with the model as well.  I could take the persisted data file and pass it on to somebody else to create a project from the model.  As it stands now, the designer has a direct relationship with the actual code, making on the fly changes.

Again, same issue with the Sql Server Diagramming tool.  No way to persist the data to disk.

So what we are left with now if you want to keep an external designer model to play with and implement later, is 2 different projects.  But committing changes from the designer project to your actual project that has your “real” code in it is no easy task either (made easier with source safe merge tools and other 3rd party compare/merge tools however).  You can play around with the model, but then when you’re done, you’ll have to get those changes over to a different project where you are actually creating your application.

I’ve had this conversation with some other people, who all agree a persistence model, whether XML, binary or even (although limiting) a proprietary persitence model would be very, very useful.  I’m hoping this is something they are looking at seriously with the next version (Orcas) of Visual Studio as an improvement to the class designer tool.  Would be nice to see the same type of implementation with the Sql Server diagramming tool, making it more of a true “designer” tool instead.



Comments

Brendan Tompkins said:

Yes, you'd think that a "propagate changes to code" feature would be part of the cd. I guess that programming this would be a nightmare, tho, cause then you'd have synchronization issues to deal with.
# December 9, 2005 10:19 AM

Eber Irigoyen said:

from that point of view, nothing that we have seen (in Visual Studio) is a designer then, the "form designer/web form designer" propagates any components you drop, any events you write, etc, to actual code, I personally think that you could achieve what you need by using source code control
# December 9, 2005 11:38 AM

Raymond Lewallen said:

Eber,

I guess what I'm saying then is that I really don't want a designer, in the Visual Studio sense of the word. In a nutshell, I want a disconnected designer. I guess Designer/Builder are interchangable in the world of Visual Studio. And I don't think source control provides a solution to my feature request. You'd still be checking in the project with the CD and the code that matches the CD. Maybe I'm not seeing what you are talking about though. Explain how source control helps me simulate a disconnected designer that I can propagate changes to the project on demand instead of on the fly. If there is an easy way that I'm not envisioning, I'd like to know about it.
# December 9, 2005 11:54 AM

Howard van Rooijen said:

FYI Francois, the guy behind the netron project, has updated the class designer powertoys for VS.NET 2005 RTM. You can get the bits from here:

http://netron.sourceforge.net/wp/?p=154

He lists the improvements as:

Design Tools Enhancements

Diagram Search
Formatting Commands
Floating Property Grid
Pan/Zoom Window
Design Surface Scrolling Improvements
Create Comments with Double-Click
Design Surface Grid

Class Designer Enhancements

Export Diagrams for Web
Display Xml Comment Command
Documentation Tool Window
Filtering Appearance
Filtering Lines
Filtering Members
MSDN Help on System Types
Fast Navigation
Interface Lollipop Labels Commands
Inheritance Visualization Commands
Show Type Command
Association and Inheritance Line Dongles
Create Tests Command
Type Creation Commands
Add Member Commands
Synchronization with Code Definition Window
View Class Diagram Command Improvements

Creating Custom Add-ins
# December 9, 2005 12:46 PM

Scott said:

"I would much rather have a true designer that lets me play around with the classes and interfaces, try a couple of different ideas and patterns as I rumble through the logic in my head, and then later commit those changes to the actual project. It also would more easily allow for 3rd party vendors to create some cool tools to use the same persisted data on disk to do some cool things with the model as well. I could take the persisted data file and pass it on to somebody else to create a project from the model. "

Can't you do that with Visio Professional?
# December 9, 2005 1:48 PM

Eber Irigoyen said:

with Visual Studio 2005 (just like with many other source control tools) you can have multiple versions of your code and there is something called "shelve" I think, which is something that is not commited into the project, something you are playing with, and when you finish it, then you commit your changes

using the tools appropiately the project "official" version is the one that is checked in, and the one on your hard drive is the one you are (working) playing with
# December 9, 2005 2:23 PM

Raymond Lewallen said:

Scott, you can with UML, yes. I'd prefer to use a simpler modeling tool like the one provided with VS. If Visio provides a new type of OO designer, I'm aware and definately should check into it.
# December 9, 2005 10:39 PM

Raymond Lewallen said:

Eber,

I suppose that shelving the CD and code is a viable option and probably the most acceptable one for me at this point. I hadn't really thought of that just because I simply think the class designer should be able to do what I ask. Thanks for the idea though, I'll look into that. However, my current source control tool doesn't allow shelving (can you guess which I'm using?)
# December 9, 2005 10:43 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Raymond Lewallen

Working primarily in the public sector during his career, Raymond has designed and built several high profile enterprise level applications for all levels of the government. Raymond now works as a solutions architect for EMC. Raymond is an agile coach, Microsoft MVP C# and also president of the Oklahoma City Developers Group and Oklahoma Agile Developers Group. Raymond spends a lot of his time learning and teaching such things as Test Driven Development, Domain Driven Design, Design Patterns and Extreme Programming practices and principles, to name a few. Raymond is also an advocate of Alt.Net. Raymond is primarily a framework guy, so don't ask him anything about UI :) Check out Devlicio.us!