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?
A Windows form in C# application is one that runs on the desktop of a computer. Visual Studio Form along with C# can be used to create a Windows Forms application. Controls can be added to the Windows forms C# via the Toolbox in Visual Studio. Controls such as labels, checkboxes, radio buttons, etc.
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).
VinayC is on to it, here's some extras that augment his answer (too hard in a comment).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With