Thursday, June 14, 2007

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.
6/14/2007 11:28:27 AM UTC
You're the man :)
6/14/2007 11:47:26 AM UTC
Hey, thanks man :)
Gokhan
6/14/2007 11:59:28 AM UTC
This is simply amazing :D
6/14/2007 12:43:28 PM UTC
Fantastic Gokhan!
6/14/2007 12:46:45 PM UTC
Ben, Diego

Thanks a lot.

:)
Gokhan
6/15/2007 2:28:29 AM UTC
Thanks again - much appreciated!

I'm thankful to see the NH support
6/15/2007 5:15:54 AM UTC
Your tool really makes my life easier! I like to have a visual picture of a complex scenario!
Comments:
a) Would be nice if one could make the labels in the relations visible, that is the source and target property names...
b) How can I distribute a complex domain model on two or more designers while keeping the relations between the domain objects and not introducing code duplication?
6/15/2007 12:57:33 PM UTC
@Gabriel,

a) Definitely true. Added to TODO list.
b) There's a DSL Tools powertoy to make such interactions possible but I didn't have time to investigate the usage.
Gokhan
7/13/2007 12:29:27 PM UTC
Wow it now really works!
Generating nhibernate-files makes creating a domain-model a lot easier!

At this moment I'm missing only a little feature..
Instead of only specifying the class with it's namespace in a mapping file like this:
<class name="myAssembly.class" table="Class">
I'd like the following:
<class name="myAssembly.class, myAssembly" table="Class">

The same holds when specifying a relation..
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):