Introduction
ActiveWriter is a visual tool, integrated into Visual Studio 2005, to model entities and relations between them. It consists of a model surface and a code generator. Entities are generated as C# or VB.Net classes.
Current version: Preview 4.1 (26/06/2008)
Download:
VS 2008: ActiveWriter Preview 4.1 for VS2008.rar (277.22 KB)![]()
VS 2005: ActiveWriter Preview 4 for VS2005.rar (1.43 MB)![]()
Source: https://svn.castleproject.org/svn/castlecontrib/activewriter/![]()

There are many tools to generate classes from diagrams, and ActiveWriter is not the best of them if all you need is a code generator. What makes it useful is that, you can instruct it to decorate generated code with necessary ActiveRecord attributes to use it in conjunction with Castle ActiveRecord, or have it generate .hbm.xml configuration to use it with NHibernate
. This way, you can instantly persist your entities to a database, retrieve them and walk through them using entity relations.
- Design Surface
This is where you model entities and relations. The page background represents the model and has some properties too, as seen in the properties window above. - ActiveWriter Files
A model is basically consists of two files: an .actiw file which holds all your model, and a .diagram file holding design surface properties, like the X/Y placement of an entity on the surface. Generated code is also kept together with these two files. Right now, ActiveRecord generates one file for each model, regardless of the number of entities in the model. If you choose to target NHibernate, ActiveRecord also generates an hbm.xml configuration file for each entity in your model. - Properties Window
Shows the properties applied to the selected item. - ActiveWriter Class Details Toolwindow
Provides a fast interface to add, remove and change properties of the selected entity. - ActiveWriter Toolbox Items
You may drag and drop items from toolbox to design surface to create your model. Relations are created by selecting the relation from the toolbox, then selecting source and target classes in the design surface. - Server Explorer Integration
You may drag tables (but not views or SPs) from Server Explorer on to the design surface. One entity per table (except many-to-many tables) will be created and relations, to some extend, will be generated between entities based on the foreign key relations in the database. Currently, SQL Server and MySQL is supported for Server Explorer integration.
When you save a valid model, ActiveWriter will generate resulting code for it, overriding any previously generated code. This means that any modifications in the generated file will be lost. ActiveWriter generates classes as partial, so your additions to a class should be kept in a separate partial class file.
Table of contents
Installation
Getting Started with ActiveWriter
Working with entities
Working with relations
Code generation options
Tutorial
FAQ
Release notes
Additional shots of the upgrade here:
http://www.flickr.com/photos/damoncarr/sets/72157601888706995![]()
Damon Wilder Carr
Please note. Damon couldn't be able to provide the source, hence his work is obsoleted by the current 2008 release.
All,
That is correct. I am really sorry about that but I took on a project lead role that basically killed me. That being said, I hope to work on some patches soon. Also, I have a working DomainDataSource control that is far cooler then I ever expected it would be.
The interesting part is that far from being a lame 'ObjectDataSource' replacement, it supports the definition of custom views which define grid projections (via TypeDescriptors) from hierarchical domain structures. Better still it supports seamless 2-way binding, sorting, and I am finishing Linq support building on the work of Ayende.
Excellent work Gokhan as always. You are a pioneer in bringing DSL technology of this kind to a mass-market. All one needs to do is look at Microsoft's efforts and there is more then a small amount of similarity to what Gokhan somehow managed to execute on with a far 'smaller budget' (grin)..
Damon
hi,
I don't know is it true place to notify about a bug, but I couldn't any link like issue manager.
I guess there is a problem when you move tables (all of them same time) from server explorer to the designer which is have a Many to Many table.
For example you have a User, Book and UserBook table (with a composite key, UserId, BookId) which you connect users and books, it doesn't generate only UserBook table. Or maybe I can't.
And thanks, great work for NHibernate. It needs a contrib project like that.
BTW I installed 4.1 for VS 2008 .
The one thing I feel is missing is validation on relationships. If I have a BelongsTo that I want to validate as NonEmpty that doesn't currently seem possible. Please let me know otherwise. Thanks for all your hard work!
-Nate Owen
Hi
I am trying to use this great tool in VS2008, but there is a bug in designer, I've dragged and dropped two tables into my model,
both of them having StartDate and EndDate column. When I delete one of them from the model and save the model, every thing is OK. Then, if I delete the other one and try to save the model it wont save. Validating the model will result this error "Error 9 Ambiguous moniker '/StartDate' encountered. It is used for both 'StartDate' and 'StartDate'".
BTW, I tried to inspect the source code. It seems that the moniker property of domain class ModelProperty is its 'Name' which is ambiguous in the scenario described above. I still don't know why this error only happens when deleting entities from the model.
I would be grateful if you help me resolve this issue.![]()

Please see news section for current status of VS 2008 specific work.
I have just finished an initial iteration of migrating ActiveWriter to VS 2008 to the point of making all units green.
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