Several confusing issues

Source: Internet
Author: User
1 foreach and for are more efficient.
This depends on the data structure adopted by the traversal set. for sequential storage (such as arrays), for is faster. for chained storage, foreach is more efficient.

2 C # access modifier type
Five instead of four. private is used when no modifier is written, while package is used in java (different from internal, internal indicates the same assembly, even two namespaces ).
Public> internal protected> internal <> protected> there are five private
It is worth noting that the internal protected modifier can be accessed in the assembly or in the derived class.

3 ViewState and Session consume more server resources
In general, sessions consume more server memory resources, while ViewState consumes processor resources because it involves encoding and decoding. In addition, in a cluster environment, the overhead of Session synchronization and replication needs to be considered; if the Session is stored in a non-Web process, the overhead of cross-process invocation needs to be considered; if the Session is saved in the database, consider the overhead of data access.

4 WebService vs Remoting
The basic structure of ASP. NET Web Services provides simple APIs for Web Services by ing SOAP messages to method calls. This mechanism is implemented by providing a very simple programming model (based on ing SOAP message exchange to method calls. Clients of ASP. NET Web services do not need to understand the platform, object model, or programming language used to create them. Services do not need to know the clients that send messages to them. The only requirement is that both parties should recognize the SOAP message format being created and used, which is composed of the WSDL and XML architecture (XSD) web Service Contract definition.
. NET Remoting provides a basic structure for distributed objects. It uses flexible and scalable pipelines to provide full object semantics of. NET to remote processes. ASP. NET Web Service provides a very simple programming model based on message transmission. NET Remoting provides complex functions, including passing objects, callbacks, and multi-object activation and lifecycle management policies through values or references. To use. NET Remoting, the client needs to understand all the details. In short, you need to use. NET to create a client .. The NET Remoting pipeline also supports SOAP messages, but note that this does not change the client requirements. If the Remoting endpoint provides. NET-specific object semantics, the client must understand them whether or not they are using SOAP.

5. WebService-related technologies
SOAP: (Simple Object Access Protocol) Simple Object Access Protocol is a Simple Protocol for exchanging information in a distributed or distributed environment. It is an XML-based Protocol that consists of four parts: the SOAP encapsulation (envelop) defines a framework that describes the content in a message, who sent the message, who should accept and process it, and how to process it; the SOAP encoding rules (encoding rules) are used to represent the Data Type instances required by the application; the soap rpc representation (RPC representation) indicates the protocols for remote process calls and responses; SOAP binding, which uses the underlying protocol to exchange information.
WSDL: the Web Service Description Language (WSDL) Web Server Description Language is the standard for describing Web services using XML documents. It is the interface definition Language of Web Services, proposed jointly by Arba, Intel, IBM, MS, etc. Through WSDL, three basic attributes of Web services can be described:
• What services do-operations provided by services (methods)
• How to access the service-data format and necessary protocols for interaction with the service
• Service Location-Protocol-related addresses, such as URLs
UDDI: (Universal Description, Discovery and Integration) the unified Description, Discovery and Integration Protocol is a new generation of Internet-based e-commerce technology standard designed to solve Web Service Release and Discovery problems. It includes a set of implementation standards for a Web-based and distributed Web Service Information registration center, and a set of implementation standards that enable enterprises to register their own Web services to the center. UDDI uses SOAP messages to find and register Web services. It also provides applications with a series of interfaces to access the registration center. For more information about UDDI, see: http://www.uddi.org/
These three technologies are related to each other. For example, the UDDI service discovers Web services through SOAP messages. They jointly solved WebService discovery, description, and access problems.

6 override overload polymorphism (rewrite, overload, polymorphism)
There is no problem with Override. The key is whether overload is an implementation method of polymorphism? Some people think that polymorphism must be late bound, but overload is not late bound, so overload has nothing to do with polymorphism. Others say that the implementation of polymorphism is divided into two forms: override and overload, one is class-level, the other is method-level, or compile-time, or Runtime polymorphism. Of course, some people think that, overload is not a unique object-oriented feature, and it also exists in process-oriented languages. In short, I prefer overload non-polymorphism implementation for this problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.