In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use OOP grammar in VB.NET, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
VB.NET adopts the functions and features of many other face object programming languages, including Java. VB.NET converts basic data types (strings, integers, doubles, and so on) into objects with properties and methods; it also introduces error trapping mechanisms for Java types (using Try and Catch); VB.NET also compiles the code into Microsoft Intermediate language (Microsoft Intermediate Language,IL); it also provides XML-based application configuration. More importantly, the ability to design object-oriented solutions can be implemented in any language. In this article, I'll compare the VB.NET language with Java;, but with other aspect object programming languages, VB.NET is now essentially going its own way.
On the other hand, Sun recently announced that it will launch a .NET-style development environment in the summer of 2003. Whether this new environment will make Java mainstream remains to be seen. One of the advantages that Java lacks is a friendly user interface. Programmers often have to spend more time learning the basic knowledge of Java programming and face object programming before writing applications in Java. With Visual Basic, developers can write programs in any way they want (often the wrong one), which becomes a big problem when maintaining the program. Before Sun's new Java IDE (integrated development environment) comes out this summer, Sun should introduce a few basic guidelines to novice Java programmers to make them realize the importance of VB.NET OOP design.
Is the OOP syntax independent?
In Visual Basic, as in Java, everything is an object-- characters, integers, and other basic types that it includes. Earlier versions of the Visual Basic language included built-in functions to handle strings; strings or integers have no properties and methods. Now, in Visual Basic, strings are almost the same as strings in Java. It is true that basic types such as string and double are the same. In Java, int and double (primitive types) still exist, but in VB.NET, they are successfully replaced by their respective objects.
Converting strings and numbers to objects makes the code clearer and less dependent on the programming language itself. Let's give an example. In order to find a character from a string, using an earlier version of VB, the programmer might write:
SMyString = Mid (sMyString,3,4)
Now, it can be replaced with:
SMyStringsMyString = sMyString.substring (3jue 4)
The VB commands are still reserved and can be used if there is a problem with the conversion, but in the second part of the above example, implemented in VB, Java, or C #, the syntax is the same. In my experience, there is little problem for VB programmers to abandon the old VB syntax and adopt "new" object-oriented programming techniques.
The event handle (event handlers) is another powerful supplement provided by VB.NET, and its functionality is also comparable to that of Java. (the event handle also becomes a "listerer" in Java. Using event handles, programmers can assign default methods to objects For example, VB.NET developers can add a handle to Datagrid to handle data changes. The event handle works similar to the callback function (callback function) in the previous two versions of VB.
Solve design problems
In face object programming, "has a" and "is a" statements are used to make connections between objects. In VB.NET, examples of this type of OOP relationship are the default button and the cancle button in the form. In VB 6. 0, the programmer needs to set the default value of the button so that the enter key has the effect of clicking the button. When I first discovered that this property was no longer available in VB.NET, I was very confused. In fact, this feature still exists, but it has been moved into the form itself. Now, each form "has a" defaults to the button property, so you can assign this property of the form to the button object. This change makes sense because the form may have only one default button and one cancel button.
One of my biggest concerns in the process of designing an environment with VB.NET OOP is that there are more design problems now. In Java, using OOP requires a lot of time before designing the class-to-class relationship. If you don't spend this time, you need the programmers on the development team to be flexible and understand the importance of making design revisions according to plan or project progress.
In VB6, many programmers also tend to write chunks of procedural code. Although this code is still supported by VB.NET, VB programmers need to integrate OOP practices and design into the solution (which consists of objects and patterns) before writing code to solve the problem at hand.
Configure enterprise applications
Visual Studio has begun to implement the configuration of applications and scenarios using techniques similar to J2EE, mainly through the XML configuration file, which organizes a standard way to set up application configuration. .net security can be configured through the control panel. In Java, the most recent example of this configuration is the security.properties file.
Web applications now also include a webconfig.xml file. In this file, programmers can select and configure database connection strings, security, and other options. This configuration type makes it easier for Java programmers to understand how .NET works, but, more importantly, it gives Microsoft developers a standard way to configure and deploy applications.
More options for developers
Obviously, Java and VB are getting closer and closer. I am sure that as OOP matures, we will see these languages more similar. For example, C # is closer to Java than it is to VB.NET.
Making a good design for a given application has always been a challenge. VB.NET makes this challenge a little easier. VB is now a face-to-face object programming language, and many design and programming options are open to developers. Similarly, system designers can more easily design OOP objects (such as reusable classes). This challenge will infiltrate VB.NET OOP design into programmers' practice and convince us that finding ways to increase the time allocated to system design is essential to obtaining solutions.
The above is all the contents of the article "how to use OOP Grammar in VB.NET". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.