Hello, I'm brand new to WCF and I was wondering how to architect my design. I want to expose methods for all my domain objects to be able to get and set their properties. I have them all split up into their own interfaces. i.e)
public interface IGroupDAO {
IEnumerable<Group> FindGroup(string criteria);
Group GetGroup(int groupID);
IEnumerable<Group> GetSubGroups(int groupID);
List<IDMatch> UpdateGroups(Group[] groups);
}
public interface IUserDAO {
IEnumerable<User> FindUser(string criteria);
IEnumerable<User> GetSubUsers(int userID);
User GetUser(int userID);
List<IDMatch> UpdateUsers(User[] users);
}
... etc
From what I understand if you create an end point for each service contract the end points are all segregated right ? The reason I ask is if I wanted to create a transaction that housed all the update statements. i.e)
CreateTransaction();
UpdateGroups(groups);
UpdateUsers(user);
CommitTransaction();
would this be possible to do if I exposed all the service contracts separately ? I want to ensure everything is saved before I commit the transaction so I don't leave my data model in an unknown state.
One idea I had was to aggregate all the interfaces together
public interface IAppDAO : IGroupDAO, IUserDAO {}
This way I could expose everything and easily reorder the updates on the service if needed. So if I had to save a sub set of groups before the user then I could save the rest of the groups or any weird cases like that. I would like to keep all the save logic in the service so the client can be dumb and say "Save all of this stuff", then on my commit the service should reorder everything properly and update the proper sources.
Let me know if I'm crazy or if I could architect this a different way ?
Thanks
p.s) I do have one more question... if I expose multiple service contracts I have to connect to each one individually right ? So I would have to authenticate to each one separately ?