Reputation: 1174
I am writing a Windows Forms application which is growing and becoming quite extensive.
Initially I thought that a separate project for graphical components and one for business logic and one for data access would be the best approach.
As the application gets larger I'm beginning to think that a more modular approach would be cleaner... e.g. a project containing user controls, business logic and data access for each 'category' of data.
For example... DAL objects relating to Products along with the associated business objects and user controls in a single project. This should end up with a larger number of projects within the solution, each one being self contained.
This may, however, cause more complications as the data is often linked (product table is linked with supplier table and orders table and parts list table etc.) So it would be difficult to completely abstract each category.
There are hundreds of software architecture articles online but not many which help you to translate that architecture into solutions, projects and code.
Could anyone point me in the right direction?
Upvotes: 6
Views: 1119
Reputation: 10215
VinayC is on to it, here's some extras that augment his answer (too hard in a comment).
Upvotes: 2
Reputation: 49195
I would keep UI, data and business layers in separate projects. This essentially reduces chance of tight coupling - for example, data layer being directly used by UI code etc. Now, if you wish to divide this vertically then you can do that as well as i.e. Products will have three projects UI, Business & Dal and so on. There can be multiple considerations out here:
As far as cross category references are concerned, they cannot be avoided but they must be done via well documented & designed contract. For example, Orders UI may call Products BL to get list of products (note that the same method will be used by many other UI components for similar functionality).
Upvotes: 5