Hi.

ActiveWriter sure looks professional (as Castle itself!).My opinion is that 
visual mapping is much better than manual mapping, but it is still a mapping.
This is an alternative approach.
My wish was to make Castle AR as similar as possible to Ruby's. In Ruby's AR, 
column names are runtime discovered. Since this is possible only in dotnet 4 
and even there with dynamic keyword, I tried using generator to automatically 
map DB to classes. Now when I add column in DB, it gets to code without any 
manual work (except right click regenerate)
I used visual mapping, kind-of (DataSet and TableAdapter)for 5 years now on one 
project, but keeping DB and code in sync was for long running project painfull. 
So I tried this approach.

This templates work like this:
Get tables, PK,FK and other columns info from DB
For each table make a class
Add PKs and other columns
Add FK using BelongTo (in table that is N:1)
Add FK using HasMany (in table that is 1:N)
So it doesnt handle N:M or inheritance, but plain relations should be OK.

But we are talking about AR pattern, so complex mappings are even unwelcome, I 
guess?

Technology is .tt templates, and is built in VS.

I will test it on Northwind and see if it "breaks" :-)


Bye,ivan

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of hammett
Sent: Wednesday, September 15, 2010 1:09 AM
To: [email protected]
Subject: Re:

I thought our answer to that was
http://using.castleproject.org/display/Contrib/ActiveWriter

On Tue, Sep 14, 2010 at 12:42 PM, Ivan Bolčina <[email protected]> wrote:
> Hi.
>
>
>
> I tried dotnet solutions for ActiveRecord and found Castle's best.
>
> However, the subsonic has nice generator of classes. I tried it to 
> make it generate Castle's classes and it worked no problem.
>
>
>
> Now I don't have to write any more mapping classes, just change DB and 
> classes get generated automatically.
>
> I personally hate mappings, and this tool is for people like me. 
> Anyone interested? J
>
>
>
> The Subsonic is new-BSD license, so I guess its not a problem porting 
> templates from it.
>
>
>
> Bye,ivan
>
> --
> You received this message because you are subscribed to the Google 
> Groups "Castle Project Development List" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/castle-project-devel?hl=en.
>



--
Cheers,
hammett
http://hammett.castleproject.org/

--
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en.

Reply via email to