VB.NET Best Practices and Design Classes

I am busy writing a program in Visual Basic.NET and I have a few questions regarding best practices. I know this is a little open, but only a few recommendations / ideas or even links will be appreciated.

Firstly, the code in the main form becomes a little long (about 1000 lines). What is the acceptable number of lines of code for the main form or any other form in this regard? I divided the program into classes, how logical this is for me. What are some good guidelines on what should be added together in a class? Should I add functions to classes as a general function, and not put the code in the main form? Also, should I refrain from adding code to modules?

On a similar note, I seek information on how to design a large software project. I know the language pretty well now, but how to actually plan, how to create a great program, or does it only come with experience?

+5
source share
2 answers

It looks like you are not creating separate layers in your application. If your main form has 1000 lines of code, you probably put business logic or even a data access code in the form itself. You really need to highlight your layers (at least the presentation level, the business logic level, and the data access level). This will help you better follow good OO principles. Regarding VB.NET specifically, here are a few articles that might help:

http://www.asp.net/data-access/tutorials/creating-a-business-logic-layer-vb

http://www.vbdotnetheaven.com/UploadFile/akrao/PracticesofCodingInVB11162005001109AM/PracticesofCodingInVB.aspx

http://www.codeproject.com/KB/vb/N-Tier_Application_VB.aspx

VB.NET. ASP.NET , ASP.NET - , Winforms.

OO, ( , ):

http://www.learnvisualstudio.net/content/series/Visual_Basic_201_Object_Oriented_Programming_and_Design_Patterns.aspx

, OO Head First Object-Oriented Analysis and Design.

+8

SOLID , .

+3

All Articles