I've tried reading some previous answers but it's not clear whether or not any of them apply to my situation, as far as I can see. Most of the questions seem to refer to web applications. I figure I'm better off stating my requirements and going from there instead of trying to reverse-engineer advice meant for a different situation. I'm essentially asking two questions:
- What does (Fluent) NHibernate support that would, in principle, allow me to achieve the requirements? I'd prefer to use the Fluent API if possible;
- What am I going to have to write myself to develop a working solution?
Broadly, the requirements are as follows:
- What I'd like to do is use FNH to persist and rehydrate models for a desktop application that would have roughly the same usage model as MS Office, for example - that is, work is kept as self-contained files which are loaded into a local instance of the application.
- The current version of the application must be able to importar archivos de todos previous versions and preserve all information except that which is declared to the user to be unsupported; by 'import' I mean 'transcribe the model information contained in file A into new file B such that file B is fully compatible with the current version, beside that which is declared to be unsupported.'
- The current version of the application must be able to exportar a current model to be compliant with only the most recent issue of the previous una gran diferencia version of the application. It is not required to supply legacy compatibility with any older revisions of the previous major version.
- The nature of the product is such that updates to the file format happen fairly frequently - aim to be able to release to the user every six months or so if necessary as a ballpark figure, and are changed in development much more frequently than that.
I have no objection to writing code to handle this, provided that:
- The coding does not take an inordinate amount of time for arbitrarily complicated changes to the schema;
- I am able to verify whether or not the translation between versions is complete by calling the FNH API through unit tests;
- I can verify that any given model will round-trip correctly between versions and only lose data which is declared to the user to be unsupported between product versions;
Entonces, para resumir:
- What, if anything, does Fluent NHibernate supply to enable this kind of use-case?
- Can the requirements be readily satisfied as they are, or will I have to make them more specific and constrained?
- What should I investigate as to coding myself?
preguntado el 08 de noviembre de 11 a las 18:11
I would suggest using a document database, something like RavenDB, MongoDb etc, for what you are trying to do. I think these would be a better fit than trying to force a RDBMS (sql server, oracle etc) and consequently nHibernate to do something that its not all that good at. not to say that it can't, but you will end up jumping through all sort of hoops to accomplish what you are asking.
One thing to note is that Fluent Nhibernate only puts a Fluent API over the Class Mapping of nhibernate.