[nhusers] Re: Best Practice: property access

2008-11-19 Thread Fabio Maulo
2008/11/19 Henning <[EMAIL PROTECTED]> > > So how is NH actually "injecting" the value into the object? If the > setter is private, it will not be available to NH, so does NH use > reflection to set the value? By default NH use reflection optimizer. -- Fabio Maulo --~--~-~--~~

[nhusers] Re: Best Practice: property access

2008-11-19 Thread Henning
So how is NH actually "injecting" the value into the object? If the setter is private, it will not be available to NH, so does NH use reflection to set the value? On 15 Nov., 12:58, FrederikGheysels <[EMAIL PROTECTED]> wrote: > As from C# 2.0, you're able to define different accessibility levels

[nhusers] Re: Best Practice: property access

2008-11-19 Thread Henning
at least, as long you're not using auto-properties from VS2008 On 14 Nov., 13:56, Tapio Kulmala <[EMAIL PROTECTED]> wrote: > Hi > > My favorite is field.camelcase-underscore. That way I can keep the > public interface of the entity clean. Don't have to publish > everything. > > Tapio > > On Nov 1

[nhusers] Re: Best Practice: property access

2008-11-19 Thread Henning
and how would I do that? And just for the "fun" of it ... can I do that with NH 1.2 as well? :) On 14 Nov., 13:50, "Tuna Toksöz" <[EMAIL PROTECTED]> wrote: > You can have nosetter access strategy in conjunction with a naming strategy, > I think > > > > On Fri, Nov 14, 2008 at 2:47 PM, Tuna Toksöz

[nhusers] Re: Best Practice: property access

2008-11-15 Thread Fabio Maulo
nosetter but you must define a field.I still have a very old note, about this matter, to add a new accessor as "read-only" (mean that don't need a field) but each time I try the implementation I'm asking me (this is seriously) : WFYAD!! In general my implementation look like this public decimal Tot

[nhusers] Re: Best Practice: property access

2008-11-15 Thread Tim Barcz
What about scenarios where a property performs some calculation. Imagine an "Order" object and OrderTotal is a property so that it can be persisted. Yet OrderTotal looks something like: public Money OrderTotal { get{ return ProductTotal + ShippingTotal + HandlingFee + Tax; } } I

[nhusers] Re: Best Practice: property access

2008-11-15 Thread FrederikGheysels
As from C# 2.0, you're able to define different accessibility levels to a propery. In that way, you can make a property 'readonly' but still having a setter to this property (which is only available inside the class). Offcourse, you're still able to access the setter using reflection ... thats a

[nhusers] Re: Best Practice: property access

2008-11-14 Thread Tapio Kulmala
Hi My favorite is field.camelcase-underscore. That way I can keep the public interface of the entity clean. Don't have to publish everything. Tapio On Nov 14, 2:40 pm, Henning <[EMAIL PROTECTED]> wrote: > Hi, > > I'm currently starting a new project using NH and I was wondering > whether I shou

[nhusers] Re: Best Practice: property access

2008-11-14 Thread Gustavo Ringel
If you want to implement your own methods to access a collection instead of giving direct access to the property retrieved by NH, or you're going to use NULL object you should use field.camelcase...for other things backingfield in the trunk will be great so you can auto implement the properties. G

[nhusers] Re: Best Practice: property access

2008-11-14 Thread Fabio Maulo
2008/11/14 Henning <[EMAIL PROTECTED]> > > Hi, > > I'm currently starting a new project using NH and I was wondering > whether I should use field or property-access in my mappings. > > Especially I'm thinking about: when I use property-access I cannot > mark properties as "readonly" (e.g. properti

[nhusers] Re: Best Practice: property access

2008-11-14 Thread Tuna Toksöz
You can have nosetter access strategy in conjunction with a naming strategy, I think On Fri, Nov 14, 2008 at 2:47 PM, Tuna Toksöz <[EMAIL PROTECTED]> wrote: > Documentation says that you can specify access strategy specifically > > name="propertyName" (1) > column

[nhusers] Re: Best Practice: property access

2008-11-14 Thread Tuna Toksöz
Documentation says that you can specify access strategy specifically On Fri, Nov 14, 2008 at 2:40 PM, Henning <[EMAIL PROTECTED]>wrote: > > Hi, > > I'm currently starting a new project using NH and I was wondering > whether I should use field or property-access in my mappings. > > Especially I'