Ok so I know I am very very new to .NET remoting and I have a question as far as best practice goes. First, I already have an in-house application that I have built and have dll's that I reference that handle all of the data for me. I want the Server version of my application to be able to utilize all of those classes and their methods and be able to pass those custom objects back and forth.
My question is, should I, apply [Serializable] to all of my classes that I want to pass back and forth and then create special classes that specifically use my methods to Get, AddOrUpdate, Delete, etc?
Right now, I have Get, AddOrUpdate, and Delete methods in all of my classes that communicate back and forth with my database. I have already learned that I can't MarshalByRefObject & [Serializable] to all of those classes or I will run into issues. So, thats why I am thinking I need to create separate classes that do "Management" (ex. Get, AddOrUpdate, Delete) as opposed to having Property definitions as well as Method calls.
An example of what I am thinking needs to be done.
[Serializable]
public class Users {
#region Properties...
private int _userID;
private string _displayName;
private string _userName;
private string _firstName;
private string _lastName;
private string _LogOnPassword;
private List<Users> _Associates = new List<Users>();
private AuthenticationLevel _authorizationLevel;
private string _userSettingsXML;
private string _active;
private string _signature;
private int _PhoneExtension;
private int _Index;
private List<UserAssignedRoles> _Roles = new List<UserAssignedRoles>();
Then to actually create a list I would have a separate class called something like UserManagement.
public class UserManagement : MarshalByRefObject {
public List<Users> GetUsers() {
}
}
Any advice is greatly appreciated!