Hi Everyone,
I'm new with CSLA.NET and I'm frustrated because I haven't found the way to make the inheritance between entities. I've read in other post that the inheritance in CSLA .NET is centred in the behavior, not in the data, but I really need to have different objects. For example, I have some objects like Person, Employee and Client. This objects share common fields and common behaviors, the only difference between this objects are some fields, like an Employee has an StarDateWorking and the client has some other fields. So, I decided to qualify a Person like a base class, and inheritance Employee and client from person. I wish to know, what's the best way to model this objects in CSLA.NET.
I appreciate your help...
Hi, thanks for your response,
I don't need an interface because the behavior is common between the objects (Person, Employee, Client). The only diference are the fields. I know that in CSLA the idea is to have inheritance centred in the behavior, but I really need to separate this objects. I have a base class (Person) and two objects(Employee, Client) are inheriting from base class. I just want to know how can i make the inheritance with CSLA?, Where Do I have to put both factory and DataPortal_xyz methods?
JT, thanks a lot for the response,
Do you have a sample implementing inheritance?
Could you send me the sample in C#?
Again, thanks a lot...
Hi Juancho, has you lucky on this? has you a sample about this? I have the same problem and I'm not sure about a proper way to implemnt it to have full benefices of this great framework. I'd like to casacade the inserts, undates, deletes etc, so I'd like to have a kind of sate on for each level.
I'm not sure if that's a good idea either.
JTWebMan:1. Make the constructor protected instead of private.
2. Make sure all you fetch, insert, update, and delete functions are mark protected and overridable.
3. I normally make all my properties overridable as well.
Now when you inherite from the object you will get all of those methods.You will not get any of the shared/static methods so you will have to write those again to follow the use cases for that object.
Hope that helps.
JT
In order to access the managed field i mark them with protected
Copyright (c) Marimer LLC