开发者

Multiple class libraries in business layer, or one?

My ASP.NET application uses only 1 SQL Server 2000 database and no more than 50 tables in it. And I copied an instance of the database to run on my develop PC, so I need to switch the connections between dev and release.

The problem is, I had created multiple class libraries in my business layer, and each class library has a LINQ to SQL class. Now I find it difficult to make all of the DBML files in the different projects use the same connection string.

So is my design wrong? Should I only use 1 class library? If I continue to use multiple class libraries, how do I ensure t开发者_如何学运维he same connection string is used in all libraries in release mode?


Put your DBML in its own class library (assembly), and reference it in your other class libraries. That way, you can make your changes to the DBML in one place.

If you have partial classes that implement business logic, I would go ahead and put those in your other class libraries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜