# 18 Ağustos 2007 Cumartesi
This is mainly a service release, fixing some nasty bugs or "features".

AW now supports international versions of Visual Studio better. Preview 3 introduced hbm.xml generation but a bug prevented it to be usable without intevention. And drag-drop support for MySQL was broken if the user have a different version of Connector installed. All should work OK now.

Download here.

Preview 3.1 Release - 18/08/2007

What's New:
  • CONTRIB-31: "Lazy" One-to-One relation. (Thanks: Gabriel Schenker)

Fixes:

  • Server Explorer drag'n drop is now supported on international versions of VS. (Patch: Daniel Rothmaler)
  • Server Explorer support changed to VS Connection Service and its Connection Hierarchies, instead of the Server Explorer's UIHierarchies to prevent the flicker during the hierarchy traversing process. (Patch: Daniel Rothmaler)
  • Closing Contrib-25. ValidateNotSameAttribute Won't be supported ATM.
  • CONTRIB-33: When adding a table (SQL Server) to the designer which has a primary key of type uniqueidentifier ActiveWriter should use "Guid" instead of "Native" as generator (Thanks: Gabriel Schenker)
  • Assembly names in NHibernate configs are incorrectly stripped from the name. (Thanx: Fedde)
  • Removed dependency to MySQL.Data.dll to prevent runtime version conflicts. Moved to IDbConnection for all metadata retrieval jobs. (Thanks: Joao Paulo Marques and Shane)

posted on 18 Ağustos 2007 Cumartesi 12:39:10 UTC  #   
# 21 Haziran 2007 Perşembe
I was about to cry after reading Scott Bellware's this post (via Roy). He says you can't develop OSS for Visual Studio because VSIP license prevents you to do so, which means my little ActiveWriter is kaboooom.

He's wrong. Well, the text he's referring to is a bit outdated. In the newer license, MS removed some clauses to make it more open source friendly, see this post for more info. In the comments of Bellware's post, Scott Guthrie also confirms that there's no restriction.

Frustration for a couple of seconds, then I'm happy again.

posted on 21 Haziran 2007 Perşembe 12:38:27 UTC  #   
# 14 Haziran 2007 Perşembe
Preview 3 has this functionality, but there are a few things to mention.

ActiveWriter use ActiveRecord assembly to generate NHibernate config files. So you'll need Castle.ActiveRecord.dll, NHibernate.dll and all necessary dependincies to make it work.



  1. Set the target to NHibernate
    This way, AW will generate .hbm.xml files for each entity in your model.
  2. Set the Assembly Path to where Castle.ActiveRecord.dll, NHibernate.dll and all necessary dependincies reside.
    The design decision was that, I didn't want to package these assemblies with AW. Rather than that, I thought user will most probably have them so they can choose whatever version they want to generate the configuration. If you don't supply the path, AW (VS, actually) will look for them in GAc and then {Your VS Path}\Common7\IDE\Castle.ActiveRecord.dll, so if you have them in one of those places, it should be fine.

    One other quirk is, if you first try to generate with the wrong path, setti ng the correct one later won't work until you restart Visual Studio. This is the framework's limitation, once you try to load an assembly and get an error, the result will be cached for subsequent tries. So VS appdomain should be restarted to make it work. I'll have a possible soliton for this for a future version of ActiveWriter (will try to load in a dummy appdomain, then in the VS appdomain)

    You may use the fully qualified assembly names for Active Record Assembly Name and NHibernate Assembly Name to target a specific version in the GAC, if you have more than one in there.
  3. When you save the model, AW will generate configuration.
I'll prepare a better documentation in the wiki.

Have fun.

Update:

AW does not work with release version of Castle assemblies (RC2?) for NHibernate generation, it works with the trunk (or with recently compiled assemblies). You can use the latest bits from the build server: http://builds.castleproject.org/cruise/index.castle
posted on 14 Haziran 2007 Perşembe 11:46:32 UTC  #   

This was sitting on the trunk for a while because of a bug in NHibernate config generation. I believe it's fixed now, so let's see if it works :)

First of all, this release is trying to be compatible with Castle trunk, it may generate code usable by released Castle components but it follows recent changes (might miss a few days). You know, Castle will be 1.0 one day and ActiveWriter will be a release, not a preview, in that day.

And I'm trying create some documentation on using.castleproject.org (Castle's wiki) to make Hammett stop whining about the lack of documentation of contrib projects (kidding!). If you're using ActiveWriter and want to share your tips, tricks, workarounds or anything about it, it would be great if you contribute to the documentation.

The most important update is the direct NHibernate configuration support. Now you can instruct ActiveWriter to generate NHibernate configuration files (.hbm.xml) for each entity in your model. Generated classes won't have ActiveRecord attributes in this case. More on this in a later post (Update: here).



Another interesting change is the use of Castle.Components.Validator instead of the ActiveRecord validators. AR changed in the trunk to use it, so does ActiveWriter.



One more exiciting news is, you can drag tables of MySQL from Server Explorer onto the modelin surface (see Michael's patch below).

Full list of changes below. A big thanks to all who sent patches, ideas and bug reports.

New:
  • Now optionally generates NHibernate hbm.xml files.
  • Namespace in generated code is now customizable (Idea: Robert van Hoornaar)
  • Imports in generated code is now customizable (Idea: Robert van Hoornaar)
  • Model classes can override model level base class definition. (Patch: Robert van Hoornaar)
  • Model classes can override model level generics generation. (Idea: Robert van Hoornaar)
  • Contrib-26: Add support for AR Nested / NH Component mappings. Allow the ability to specify a column prefix for active record. (thx: Adam Tybor)
  • Optionally generates classes implementing INotifyPropertyChanged.
  • Support for drag-drop from Server Explorer for MySQL databases. Requires MySQL Connector/Net (5.1) (included). (Patch: Michael Morton)
  • Support for custom types through IUserType. See http://support.castleproject.org/browse/CONTRIB-28#action_11456 for usage. (Patch: Ricardo Stuven)
  • Ability to define a nested class with a different property name than the nested class (Idea: Craig Neuwirt)
Fixed:
  • Contrib-23: Produces CascadeEnum instead of ManyRelationCascadeEnum
  • Ability to generate virtual properties to support Lazy properly (thx: Ayende)
  • Make sure that Char and AnsiChar types are treated as a System.String types, instead of System.Char types (patch: Ayende)
  • HasAndbelongToMany does not take custom property names and not found behavior into account.
  • Can’t add a Many To Many relationship to 2 entities when the Class and Table names are different.
  • Column keys in many-to-one relations is not optional. (Patch: Robert van Hoornaar)
  • Partially fixing NHibernate code generation errors. Now works with a workaround.
  • Nullable types only when NotNull=false (Patch: Ricardo Stuven)
  • Changed to Castle.Components.Validator
And just one more thing. Someone asked me if ActiveWriter is a competitor for Linq to SQL. AW is just a servent of the heavyweight champion, NHibernate/AR combo. Linq to SQL is competing with NHibernate. I didn't have time to examine Linq to SQL designer, but it's built using DSL Tools just like ActiveWriter so some functionality should be alike. Other than that it's the framework, not the tools, important.
posted on 14 Haziran 2007 Perşembe 08:29:25 UTC  #   
# 09 Mayıs 2007 Çarşamba
Ayende, in his post on virtual entry barriers / learning curve of Castle pieces, said:
One of the main differences between OSS and Commercial software is the amount of time that is invested in the frills. Active Record and NHibernate has a designer, which is nice, but it is not a level 1 priority to any of the people using either Active Record or NHibernate. The reason is that both those frameworks were built knowing that a designer is not something that you should need in order to work with them.
That is, of course, super true for MonoRail and when I started working on ActiveWriter, I said "ActiveRecord is so simple, no one gonna use a code generator for it". Now I think somewhat different, in the context of O/RM designers.

When I think of working with ActiveRecord, I see it in two different parts. First is the sceleton of an entity; all the attributes tagging the class, properties and fields to describe the model to ActiveRecord and then NHibernate, eventually.

    [ActiveRecord()]

    public partial class Entity : ActiveRecordBase {

 

        private int _key;

 

        [PrimaryKey(PrimaryKeyType.Native, ColumnType="Int32")]

        public int Key {

            get {

                return this._key;

            }

            set {

                this._key = value;

            }

        }

    }


This code is a no brainer to write and AR has quite good documentation to get you there easily. But it's so repetative that it's the perfect place for using a designer. I don't say that people using ActiveRecord should forget all the attributes to define an entity alltogether, but once you studied the underlying workings of the framework I believe even the most basic framework can use a designer when it comes to the brute force part of the code. After all, you are designing some entitities and that's what a designer do best.

One problem here is that it's not easy to modify this kind of generated code. Thanks to 2.0, partial classes help great when adding new functionality, but it's impossible to modify generated getters and setters. DSL Tools is using the term "double derived" for the approach used to solve this problem, use an inherited empty entity instead of the original one around to make it possible to override properties. This model works fine in DSL Tools context but might make real world entities complicated. This one and solutions like this which makes code more bloated are, I believe, the dark side of code generating designers.

There is also the process of giving the entity some brains; validation, query helper etc. I, again, can see the value of a designer here. ActiveWriter can generate entities with ActiveRecord validators (and there's a JIRA entry waiting to port it to Castle validators). Thanks to his permission, I'll integrate Ayende's Generator into ActiveWriter to make it generate code with all the typed query functionality but ActiveWriter of course won't be writing the query.

The other part of working with ActiveRecord is knowing what the framework gives you, what does it do on behalf, what are the list of things to know beforehand to know before it starts persisting. You should know about lazy loading, order of saving, inverse relations etc. This is the point when you instruct the framework to manage what you designed before, and I think where a designer should keep it's hands off. ActiveWriter, and tools alike, should help developers to define metadata. They should not act like metadata manipulators to do the programming. I consider Ayende's comments above true in this part of the usage. A good O/RM designer should work without getting the way, and shouldn't make the user careless by doing the thinking on behalf.

posted on 09 Mayıs 2007 Çarşamba 14:42:35 UTC  #   
# 25 Nisan 2007 Çarşamba
Both about MonoRail, actually.
Seeing your work used in screencasts is priceless.

posted on 25 Nisan 2007 Çarşamba 08:57:28 UTC  #   
# 11 Nisan 2007 Çarşamba
I'm helping a client to customize and implenet MSF for Agile. As always, it's virtually impossible to find information on details when it comes to MSF. I find Scrum much more documented in this regard, there are tons of information on nearly very aspect of Scrum (web sites, screencasts, papers etc.) while you have to dig MSF v4 Forum for some tidbits.

One possible solution to info scarcity on MSF is Microsoft Solutions Framework Essentials, a nice book by Michael S. V. Turner. In the book, each track is marked with some deliverables but it's not clear who is doing what. I tried to construct a martix, some based on the info on the book and some based on my understanding of the concepts. I'm not 100% sure on Stabilization and Deployment tracks, so any corrections / suggestions are welcome.

MSF Agile Deliverables Matrix 1.0.pdf (229.36 KB)



Update: Michael Tsai makes a correction: "According to Mike Turner's book, I think Product Management should be the advocacy for Vison/scope document, instead of Program Management. See Figure 4-4 and p. 169-170."
There are also some suggestions on the MSF Forums thread on the matrix. I'll incorporate suggestions to the chart in the near future.
posted on 11 Nisan 2007 Çarşamba 20:28:55 UTC  #   
# 18 Mart 2007 Pazar
Download here.

What's new:
  • Generics support (ActiveRecordBase<T> & ActiveRecordValidationBase<T>) (Generics is the default in the designer)
  • VB.NET seems OK (Not tested extensively).
  • Auto-sensing project type (C# or VB.NET) for code generation. You don't have to set that in the model anymore.
  • New ActiveWriter Class Details toolwindow. Can be used for rapidly adding class properties. (Idea: Ayende)
  • AR validators are supported for each property (not for field, key, composite key, timestamp or version) through a designer.
  • Ability to customize the base class. You can substitude your own base class from the editor or generate classes without a base class.
  • Ability to customize the source property name for associations. This is necessary for hierarchical objects, where they point to themselves, and using the class name resulted in un-compilable code in previous build. (Reported By: Ayende)
  • More domain consistency check through validations when opening / saving.
  • Applying pluralizing rules to the table name from the entity name if not specified. (Idea: Ayende)
  • Ability to select a property for optional DebuggerDisplay attribute.
  • Ability to decorate classes with GeneratedCodeAttribute.
  • No more setting Custom Tool property of an .actiw file to ActiveWriterCodeGenerator manually after creating the file. It's done automatically. (Thanks: Bogdan Pietroiu)
  • Key icon decorator on class shapes if a primary or composite key property exists (pure cosmetic).
  • Key icon decorator on class shapes if at least a property has validator(s) set (pure cosmetic).
  • Connector shapes changed to a more-UML-like notation.
  • Extended nullable support. You may choose between nullables through external Nullables library (1.1 style) or native nullables usage of 2.0 framework.
  • Some added properties to support changes (not all) in Castle trunk for ActiveRecordAttribute, PropertyAttribute etc.
  • Built with VS SDK v4. Includes new and improved version of DSL Tools redistributables.
What's crippled:
  • Using Output window less when doing drag-drop from Server Explorer to prevent a bug.
Known bugs / problems:
  • On international versions of VisualStudio, Drag'n drop support from Server Explorer generates entitites but not properties. You may create entities manually as a workaround.
  • Randomly, when you drag tables from Server Explorer, design surface gizes an error and cannot render any entities any more. You may save and re-open your .actiw file and it will catch up.
Screenshot below displays:
  • Validation support
  • Generic code generation
  • Nullables
  • Class details tool window
  • Visual hints on diagram elements
posted on 18 Mart 2007 Pazar 15:59:05 UTC  #   
# 12 Mart 2007 Pazartesi
I was using a private SVN for ActiveWriter and thanks to Hammet, the source is now available through Castle Contrib Repository.
Having source on an open repository is great. AW now has it's own Ohloh page :)
  • Codebase: 27,938 LOC (Most of them generated by DSL Tools, actually:)
  • Effort (est.): 7 Person Years
  • Project Cost: $362,806
I feel good! :)

posted on 12 Mart 2007 Pazartesi 10:11:10 UTC  #