Accept change: from VB programmers to VB.NET programmers

xiaoxiao2021-03-06  112

Dienie: Programming experience from VB to VB.NET (1)

First, accept the upgrade of development tools, but this is only. The tool is better, the program is basically written, and the set of old words: no silver bomb.

Second, the first thing to pay attention is to the architecture, that is, the structure of the entire system. There are many good architectures to be used, don't do everything yourself, but you must understand, and do more exercises.

Third, learn some object-oriented concepts, such as the encapsulation, inheritance, polymorphism of the object.

Fourth, make full use of VB6 to VB.NET migration tool, which can be familiar with some changes, some common namespaces and classes can also mix themselves.

5. If you always find that some code needs to be copied, paste, then make them components and custom controls, because the development of components and custom controls under .NET is too convenient.

6. To be cautious, treat multi-layer architecture, it is very attractive (what is the advantages?). There are also drawbacks: data should be shuttle between too many layers, more influential efficiency; there are too many stratification, which is very "heavy" for small projects; the agreement before the development should be very perfect, otherwise it will only make the system more Not good maintenance; as the customer's requirements change, the advantages of multi-layer development will gradually disappear.

7. For small projects, the best architecture is "simple, enough".

Eight, you should use the module (module).

Nine, start with the namespace of the project, try not to use the system default settings. Otherwise, when you want to make changes, you will regret it.

Ten, strongly recommend FORM inheritance, but the premise is that you have to design it, including font and picture properties. If you come back to change, then the instance that has already been formed will need you to change manually.

Eleven, use try ... catch ... finally to armed your exceptional processing, throw away the discussion of ON Error Goto. (I found someone to write the wrong handling, but I forgot the ON Error Goto.

1. Take advantage of the new features brought by VB.NET. For example, using Oralse and Andalso's logical operators with short-circuit features when necessary; the function returns to use return instead of functionName = Result; logic related code to classify # regin ... # end regin

12. Select when performing data retrieval

ADO.NET

The order of the object is:

Executesclare

,

ExecuteReader

,filling

DataSet

.

转载请注明原文地址:https://www.9cbs.com/read-99101.html

New Post(0)