interface-oriented, object-oriented and aspect-oriented programming differences
Interface-oriented programming is one of the essence of the object-oriented programming system (blog Park article link interface-oriented programming in detail (a)--ideological basis)
Interface-oriented programming interface is a set of rules
Object-oriented programming for encapsulation reuse, flexibility, extensibility of things with the same behavior and attributes
Aspect-oriented programming (AOP aspect-oriented programming)
Differences between interfaces and classes
Keyword Class,interface
Interface cannot be instantiated
Interface supports multiple inheritance
Interfaces do not implement methods and properties
Classes that inherit an interface need to implement all the methods of the interface
Class can be instantiated
Classes inheriting classes do not need to implement all methods of non-abstract adornments
A class can inherit multiple interfaces, but can inherit only one class
Reflection
Reflection (Reflection) is an important mechanism in. NET that, through reflection, can get members of each type in. NET, including classes, structs, delegates, interfaces, and enumerations, including methods, properties, events, constructors, and so on, at run time.
You can also get the names, qualifiers, parameters, and so on for each member.
In design mode
Use of reflective technology to simplify plant implementation
1. Factory Method: By reflection you can pass a subclass name that needs to be implemented to the factory method, so that you do not have to instantiate the class in the subclass.
2. Abstract Factory: Use reflection to reduce the subclass of the abstract factory.
The use of reflection technology can greatly simplify the generation of objects
1. Command mode: You can take the command's type name as a parameter directly to get an instance of the command, and can execute the command dynamically.
2. Enjoy meta mode: Use the reflection technology to instantiate the share to simplify the meta-factory.
reflect the demo code as follows:
Static class Program {///<summary>//The main entry point of the application. </summary>//[stathread] static void Main () {//application.enablevisualstyles () ; Application.setcompatibletextrenderingdefault (FALSE); Application.Run (New Form1 ()); System.Console.WriteLine ("List all types in an assembly"); System.Reflection.Assembly represents an assembly, which is a reusable, version-free, and self-describing common language runtime application building block Assembly a = Assembly.LoadFrom ("Reflec Tion.exe "); Type declaration type[] mytypes = A.gettypes (); foreach (Type t in mytypes) {System.Console.WriteLine (t.name); } System.Console.ReadLine (); System.Console.WriteLine ("List all methods in Hellword"); Type ht = typeof (HelloWorld); System.Reflection.MethodInfo discovers the properties of the method and provides access to the method metadata methodinfo[] MIF = ht. GetMethods (); foreach (MethodInfo MF in MIF) { System.Console.WriteLine (MF. Name); } System.Console.ReadLine (); System.Console.WriteLine ("Instantiate HelloWorld, and Invoke SayHello method"); Instantiate HelloWorld Object obj = activator.createinstance (HT); String[] s = {"Zhenlei"}; Instantiate HelloWorld Object objname = Activator.CreateInstance (HT, s); System.Reflection.BindingFlags//Specifies the flags that control the binding and the member and type search methods performed by reflection. This enumeration has a FlagsAttribute attribute that enables the bitwise combination of its member values. BindingFlags flags = (BindingFlags.NonPublic | BindingFlags.Public | bindingflags.static | BindingFlags.Instance | BINDINGFLAGS.DECLAREDONLY); MethodInfo Msayhello = ht. GetMethod ("SayHello"); Msayhello. Invoke (obj, null); Msayhello. Invoke (objname, NULL); System.Console.ReadLine (); System.Console.Read (); }}///<summary>//HelloWorld class///</summary> public class HelloWorld {string myName = null; <summary>///constructors///</summary>//<param name= "name" ></param> Public HelloWorld (string name) {myName = name; }///<summary>///constructor///</summary> public HelloWorld (): This (null ) {}///<summary>//Properties///</summary> public string Name { get {return myName; }}///<summary>//////</summary> public void SayHello () { if (MyName = = null) {System.Console.WriteLine ("Hello World"); } else {System.Console.WriteLine ("Hello," + myName); } } }
XML Web service differs from. NET Remoting
The WEB service uses the messaging mechanism, while the remoting uses the RPC.
Web service can be used on different platforms, in different languages, remoting only for. NET.
Remoting is more efficient than XML Web Service. ( . NET Remoting and WebService)
The difference between early-binding and late-binding
Early-binding Compile-time binding
Late-binding Run-time bindings
Whether Assembly.Load is a static reference or a dynamic reference
Dynamic
What is the difference between Assembly.LoadFrom and assembly.loadfile,2?
Assembly.LoadFrom loads DLL files and other DLLs that they reference
Assembly.loadfile loading only the corresponding DLL files
What is assembly qualified Name
Assembly qualified name (assembly qualified name), which determines an assembly more than the file name, contains the file name but also contains the version, public key, and zone.
Assembly.Load ("Foo.dll") the correct method for loading assemblies
Not correct. should be: Assembly.Load ("foo, version=1.0.2004.0, Culture=neutral, Publickeytoken=8744b20f8da049e3")
How a strongly signed assembly differs from a non-strong signed assembly
A strong name consists of an assembly's identity plus a public key and a digital signature. Where the identity of the assembly includes simple text names, version numbers, and culture information, if provided.
There are three main functions of strong names:
distinguish between different assemblies;
Ensure that the code has not been tampered with;
In. NET, only assemblies with strong name signatures can be placed in the global assembly cache (strong names (1) Protect code integrity with strong names)
Can a DateTime be null?
DATETIME cannot be null. DateTime is a value type and value type cannot be null. Only reference types can be assigned a value of NULL.
What is JIT, what is NGEN, and what are the advantages and disadvantages of each?
JIT (Just in time) This is the final machine-oriented compiler that we build with the. NET Compiler
The native Image Generator (Ngen) is a tool for improving the performance of managed applications.
Ngen.exe Create native images (files that contain compiled processor-specific machine code) and install them into the native image cache on the local computer.
The runtime can use the native image from the cache without having to compile the original assembly with the just-in-time (JIT) compiler.
Because the JIT compiler converts the assembly's MSIL to native code when a single method is defined in the calling assembly, it must have an impact on the performance of the runtime.
In most cases, this performance impact is acceptable. More importantly, the code generated by the JIT compiler is bound to the process that triggered the compilation. It cannot be shared between multiple processes.
In order to be able to share generated code between multiple processes that invoke or share a set of assemblies, the common language runtime supports a pre-compilation pattern.
This pre-compilation mode uses the native Image Generator (Ngen.exe) to convert MSIL assemblies to native code, which works very much like the JIT compiler.
The Ngen.exe operation differs from the JIT compiler operation by three points:
It performs the conversion from MSIL to native code before the application runs, rather than during the run
It compiles a complete assembly at a time, rather than compiling one method at a time
It persists the code generated in the native image cache as a file on disk
How do I manage the life cycle of objects in the. NET CLR's generational garbage collector? What is the end of uncertainty?
The. NET garbage collector principle
. NET garbage collection is divided into 3 generations and can be enforced by gc.collect
The difference between Finalize () and Dispose ()
Finalize releases only unmanaged resources
Dispose to release managed and unmanaged resources
Finalize and Dispose share the same resource-release policies, so there is no conflict between them.
is the Using () mode useful? What is IDisposable? How does it support the end of certainty?
using () qualifies resource scopes and automatically releases
IDisposable is an interface that has a method of Dispose () that can be called when the object is scoped, such as when a using bounds is called.
Tasklist/m the role of the "mscor*" command line
Lists all processes and modules that use a DLL that conforms to the name in quotation marks.
What's the difference between In-proc and Out-of-proc?
In-proc in a process, the process can share code and data blocks, Out-of-proc is out-of-process, out-of-process interoperability needs to be implemented by interprocess communication.
Out-of-proc is based on what technology to achieve
. Net Remoting Technology or WCF technology
When you run a component in ASP, it's running in Windows XP, Windows 2003, and in which process each
XP:aspnet_wb.exe
2000:inetinfo.exe
2003:w3wp.exe
Note: Thank the following netizens comments ~ ~ ~
This article just collated the online spread of the "programmer level Appraisal book" Intermediate. NET programmer questions and answers.
This article is not really used to identify the programmer level, I believe that we have their own standards in mind.
This part of the classic question, enough to write a series of blog post. But I have a limited level, the park has a good link to the article, I added.
This article is reproduced from the North underworld ice King