I was recently involved in a discussion at another forum (the DDD community) and have come to some rather humbling realizations about what I really want from my efforts and how affected I am by chosen technologies.
I sat down and came up with a list of things I want, why I want them, and how the technologies I am familiar with fit into things. From this point on, I am unconcerned with patterns and methodologies, how much or little work the result will incur, or whether or not the result is anemic or rich. I just want something that can accomodate my requirements. However, I am unsure whether or not something exists that will do that. I am hoping that by listing these here, one of you will know of something.
On to the list:
1) Must be able to change an entity parent by it's foreign key, by reference, or by manipulating the parent's collections.
The reason I need this is because there are times when a viewmodel provides me with a parent id via a dropdownlist and I simply feel it's going around your elbow to get to your thumb by selecting the parent and then assigning that, when you already have the id. Just assign that and save. However, I also need the references in order to ease the pain of building navigational display elements.
Linq2Sql can do all three, but is limited to SqlServer. Not acceptable.
EF4 can do all three, but if a foreign key already has a value, it throws an error. Not acceptable.
NHibernate doesn't allow both a reference and it's foreign key in the same entity. Not acceptable.
2) Must be able to selectively apply updates on specific entities without automatically saving all changes made to all manifested entities.
The reason I need this is because there are times when several entities may be in a state of edit, and batched saved. Those that pass internal test should be able to make it through the save process, leaving the ones that failed the test unsaved.
Linq2Sql apply all pending changes on SubmitChanges(). Not acceptable.
EF4 also applies all pending changes on SaveChanges(). Not acceptable.
NHibernate works correctly in this regard.
This is it. Those two simple things would free me up so much it isn't funny. So are there any persistence engines out there that comply with the list? Or is there some trick to any of the three that I am unaware of, that might make them work for me?
Note: While I am aware that what I am trying to do is NOT considered good practice, it is, nevertheless, what I wish to do. I just need to figure out a way to do it.