Castle ActiveRecord also has mapping via attributes. A little simpler and more convention-based than NH attributes (if memory serves). You can use these attributes only for mapping if you want and use NHibernate directly instead of ActiveRecord. I did that once some years ago.
People seem to favor fluent code based mapping probably because it reduces cruft in entities and offers the possibility of auto mapping. On Wednesday, February 8, 2012 at 6:52 AM, Rasmoo wrote: > James Gregory replied to a similar question once. I think it sums it > up alright. > > http://stackoverflow.com/questions/680147/nhibernate-fluent-vs-attributes > > On Feb 7, 6:50 pm, Alex Maines <alexmaines.softwareengin...@gmail.com > (http://gmail.com)> > wrote: > > Dear all > > > > I recently wrote my own ORM system (long story). It is basic but very > > effective. It has no known bugs, but few of the features of a > > sophisticated ORM tool like xHibernate. I do think it could be > > extended to have more features if that were required but it has never > > been necessary. > > > > My starting point was to use metadata for mapping the relationships, > > stating the relationship between each entity class's properties and > > the corresponding columns in the DB as attributes, like so > > > > [DataColumn("ID", SqlTypes.Int16), PrimaryKey] > > public int ID { get; set; } > > > > This also allowed me to declare custom type converters for marshalling > > types from my Oracle DB to .Net (eg converting 0/1 to boolean T/F > > where the Oracle SPs returned NUMBER values). > > > > I have three questions for the group. > > > > Question (1): does Fluent Hibernate provide anything like this as a > > mapping strategy? > > > > If not..... > > > > Question (2): is it a bad idea in absolute terms? Can anyone think of > > a killer argument against it as a design pattern (nearest comparison > > without betters samples/screenshots is the DataContract pattern in > > WCF). > > > > Question (3): if everyone does like the idea, how do people feel about > > adding it to Fluent NHibernate or branching to create a new product > > called something like Meta NHibernate? > > > > Please note that the answer to question (2) is not that it is harder > > to pronounce.... > > > > Looking forward to any comments anyone may have. > > > > Alex > > -- > You received this message because you are subscribed to the Google Groups > "Fluent NHibernate" group. > To post to this group, send email to fluent-nhibernate@googlegroups.com > (mailto:fluent-nhibernate@googlegroups.com). > To unsubscribe from this group, send email to > fluent-nhibernate+unsubscr...@googlegroups.com > (mailto:fluent-nhibernate+unsubscr...@googlegroups.com). > For more options, visit this group at > http://groups.google.com/group/fluent-nhibernate?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.