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:04

By 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:37

PS: 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.

asked Oct 22 '08 at 13:48

Editor's gravatar image

Editor
46156156157


One Answer:

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?

why is GetValue / SetValue 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

[Field(PairTo="Master")] in detail**

AFAIK [PairTo] must be applied @ one side of relationship only.

answered Oct 24 '08 at 02:23

Editor's gravatar image

Editor
46156156157

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA