Hello X-Tensive: I start my very first open source project with DO 4.0. I have several questions about your new amazing Product. Should i use Persistent oder Entity as base class for my own classes? (I use Entity at the moment , as you do in your Unit Tests ) Concerning Entity: why do i have a protected OnGetValue, but OnSetValue is private/sealed? why is GetValue / SetValue private/sealed? Will you provide a Guid Key Generator or should i program my own? Thanks in advance Updated at 22.10.2008 15:02:04By the way: If i declare [Field(PairTo="Detail")] in master [Field(PairTo="Master")] in detail i get an Domain.Build Error, that this key already exists. This is no problem at all, but for documentation issues symmetrical PairTo attributes should be allowed (I think in 3.9 it was) Updated at 22.10.2008 19:11:37PS: I ve used PostSharp (Laos) to accomplish this. Bit i think this is overkill to the virtual OSetValue methods This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by MSE-iT. |
Support (Xtensive) wrote:> Should i use Persistent oder Entity as base class for my own classes? You must use Entity. Persistent is "common base" - i.e. a Structure is also derived from it. **> why do i have a protected OnGetValue, but OnSetValue is private/sealed?
True, they are sealed in Entity. We did this to prevent the logic they contain to be modified, but didn't provide an alternative for now. You actually can implement OnXxx-like code right in property getter or setter now, and this is what we recommend. Real OnXxx events must be used to implement some common logic, such as version change on property change. > Will you provide a Guid Key Generator or should i program my own? It must work - just declare Guid key. **> [Field(PairTo="Detail")] in master
AFAIK [PairTo] must be applied @ one side of relationship only. |