Monday, 26 November 2007

ActiveWriter for VS 2008

One of the recent additions to our toolkit has been ActiveWriter - a GUI for generating NHibernate classes and mapping files.

So before we can make the final jump to using 2008 for all our development, ActiveWriter needs to work.

Gökhan is planning an update that will work on 2008 - hopefully in a few weeks.

Wondering if it might not be too hard to do the port myself, I dove in and pointed VS 2008 at the latest source code.

Ouch!

I'm not an expert in the DSL tools stuff (which probably doesn't help), but things do appear have changed a little between 2005 and 2008. I wonder if you're better off creating new projects and copying over the content rather than just doing an upgrade.

Specifically in the ActiveWriter code, it makes use of the IVsDataConnectionsService interface. I'm not sure of the history of this interface, but it does appear that it has disappeared from the 2008 SDK.

Curiously, this interface doesn't even appear documented in the 2005 SDK, and I'm not clear what the appropriate replacement should be.

7 comments:

Damon Carr said...

That is so funny I just came to this while searching on the Internface. I am actually doing the port now.

This service was replaced (and I know I will find it I just cannot remember the damn name).

So far everything works OK but this final issue (as far as I can tell).

I hope to conclude this work (or post why I didn't) here shortly.

I am working from the latest trunk of castle contrib... I was doing this mostly for myself and my consulting firm, and was simply going to let you guys know the end result. If I finish this first, I will of course add it as a branch for your review.

This is SO critical to me now as I recently finished rather grueling work on another component which is an NHibernate/ActiveRecord DataSource control (that also handles Linq perfectly).

It's meant to replace both the Linq and ObjectDataSource controls and I would certainly consider adding it as a contrib to ActiveRecord (although I think there is already some kind of DataSource around I think... Not sure if it does what this does).

This is a kind of 'universal' ORM DataSource that was quite difficult (suprisingly) to build as I was not 100% good with the VS Designer extensions...

After reviewing Linq, their GUI for mapping, etc. I am underwhelmed.

As far as I know there is still no way to do disconnected updates which could then be persisted without some kind of home-grown work (wouldn't be that hard I suppose).

I often must provide compelling evidence to my clients on why it makes sense to use NHibernate (or ActiveRecord which is by proxy also NH).

Now with Linq I must come to the table in VS2008 using 'at least as good' tools...

Thanks,
Damon Carr, cto
agilefactor

Damon Carr said...

All,

I have just finished migrating ActiveWriter to VS 2008. It seems to work quite well. I have a fairly extensive background in DSL/'VS-SDK so this was not all that bad, however there were some non-obvious monsters lurking.

For example, the IVsDataConnectionsService has gone away from what anyone can tell me and I replaced it with IVsDataExplorerConnectionManager.

In addition a lot of changes were required to get this working and installing using the latest SDK with the DSL tools. More can be found in comments (or do a diff) on the ported code.

I also added some 'nice to haves' like an indication on the VS 2008 startup splash that this is an installed Package, as well as other standard best practices for add-in deployment. You can easily turn these off or on if for some reason you would prefer they not adorn the VS 2008 environemnt at startup.

I created a local branch off the contrib trunk called 'VS2008'. I'll send this as a ZIP to Gökhan Altinören as well as follow the directions for contribs. This should be fairly easy to make work on either 2005 or 2008 as the target but I am not sure how you maintain this. Obviouslly until it can be more extensively tested keeping this as a branch makes sense in my opinion.

I have another fairly significant project for contrib that I hope to add related to a replacement for both teh Linq and Object Data Source controls which is fairly compelling for the following: NHIbernate, ActiveRecord, Simple Non-ORM Domain POCO, and Linq.

Kind Regards,

Damon W. Carr, CTO

agilefactor

David Gardiner said...

Damon, I forgot to update my post to say that I too had finished the migration. I posted my code to the Castle bug tracking system.. Have a look at http://support.castleproject.org/browse/CONTRIB-86

-dave

Damon Carr said...

Ha ha! I finished this as well! Check out:


http://using.castleproject.org/display/Contrib/ActiveWriter?focusedCommentId=10518529#comment-10518529

I added a ton of branding enhancements (like initial splash branding) as well as upgrading to the latest weekly of WIX and much much more..

I will check out your code and see how alike our minds are!

Damon

Anonymous said...

Great post. I just installed VS08 and I really need to get AW working.

@Damon ... have you posted your code? I checked contrib but didn't see anything.

Also, does anyone know when we can expect an "official" 2008 version of AW?

Thanks again - wayde

David Gardiner said...

I had an email from Gokhan today. He doesn't have VS2008 himself yet, but is keen to incorporate the work Damon and I have done.

Another issue is whether the next version can support both 2005 and 2008 or if we need separate distributions.

-dave

breezback said...

Hi,

I'm writing a winform application,
I'd like to use activewriter, nhibernate with sqlite.

What is the performance for standalone application? I might want to port to mobile afterwards.

Is there any quickstart/documentation?

Thanks,

Ilan