我很想知道,是否有明智的方法设计C#ll,以便你随后能够重建,并以“安全”的方式将新版本作为退缩的替代。 安全大多意味着签名不会改变。
I was contemplating the differences between using a database primarily via LINQ vs using it primarily with stored procedures. On advantage of stored procedures is that you can change any individual stored procedure without doing a recompile/republish of your application. So, I was contemplating what it would take to have a similar ability by creating a solution where all of the database-oriented code was in a separate project using fun stuff like dbml files and whatnot . Obviously if you stuff garbage on the inside of one of your replacement LINQ functions, the replacement will cause issues, but this disadvantage exists.
我提出的主要规则是:
- If the database model changes, it is time to do a recompile.
- Protection against any of the signatures changing. No existing public methods should be removed.
My intuition is that a big part of doing this would involve the use of an interface that was referenced by the separate project and used by the main project in order to make all the calls.
因此,这一想法是否有意义? 是否有任何战略可以用来使这种合理安全(即不增加与编辑储存程序有关的新风险而不重建申请)?