Use .NET architecture your system (the construction idea of ​​the base class)

zhaozj2021-02-16  57

After .NET comes out, give our VB programmers a bright feeling, not to say that he is simply upgraded from VB6.0 to VB7.0, is a feeling that is not seen by others. . Previously, the status of the VB programmer always is more than other languages. Now no, .NET achieves real object-oriented, it looks a little uncomfortable, but it is still a bright thing for people with Java, PB, so we can build your own VB. The NET base class is a solid preparation for future development. It is not necessary to develop it from the beginning, but inherit your own gradually constructed base class, this is a kind of thinking, an accumulation, it is for us Very good fully utilization. I share my base class's components and share with you:

1. Base class: All kinds of parent class, other classes are inherited by this class, the most original class.

i. Error handling classes: Inherited by the base class, mainly responsible for the error setting, and acquisition, and acquisition, and acquisition.

II. Log Processing Class: Inherited by the base class, mainly responsible for logging key information in the program to the log library.

The above is three basic classes, of course, can also be established:

III. Public inspection: Inherited by the base class, mainly responsible for some common data inspection methods in the program

IV. Public Module, Control, Object Generation Class: Responsible for generating the control of the control you want to display according to parameters

v. Public interface framework generation class: generates a large frame setting of the picture

Vi. Public Interface Frame Generation Interface: Set an interface, inherit and implement these interfaces, inherit and implement these interfaces, can generate different styles of picture frameworks with public interface frameworks

The definition of a subclass (error handling class, log processing class, etc.) can be added in the base class, and it is defined as a shared form. In other subclasses, naturally includes definitions of processing errors and log processing, instantizes these classes, can be easily handled, record logs, etc., and these two classes are defined in shared forms. So their attributes and parameters are very easy to get in other subclasses, and the values ​​set in this subclass,

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

New Post(0)