Site Home

Introduction
Getting Started
FAQ
Downloads

Introduction

[I'm no longer maintaining ActiveWriter, thanks for all the support. Latest source @ github]

ActiveWriter is basically a tool to model entities and relations between them. It consists of a modeller and a code generator. Entities are generated as C# or VB classes.

Current version is Preview 4.1. You can download it here.

As ActiveWriter itself, the documentation on this site is a preview and will be improved.

There are many tools to generate classes from diagrams, and ActiveWriter is not the best of them if it's only the class generation. What makes it useful is that, you can instruct it to decorate generated code with necessary ActiveRecord attributes. This way, you can instantly persist your entities to a database, retrieve them and walk through them using entity relations.

ActiveWriter is a Visual Studio 2005 addin, and spreads to the various parts of the IDE as seen in the picture above:

  1. 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.
  2. Model Explorer
    This is a tool window to quickly find a model element in your domain. Selecting an item in this window is the same as selecting an item from the design surface.
  3. 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.
  4. Properties window
    Shows the properties applied to the selected item.
  5. 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 two classes in the design surface.
  6. Server Explorer integration
    You may drag tables 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 is the only supported database for Server Explorer integration.
  7. Descriptions
    Some propeties have descriptions attached.

Whenever a model file is opened or saved, validation takes place. You will be warned by the editor if the model is invalid, based on one one or more rules. You may check validation errors in Error List window.

When you save a valid model, ActiveWriter will generate resulting code for it, overriding any proeviously 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 seperate partial class file.