Archive for January, 2008

8 CHAPTER 1 THE PHILOSOPHY OF .NET (Web page design)

Thursday, January 3rd, 2008

8 CHAPTER 1 THE PHILOSOPHY OF .NET The truth of the matter is that many of C# s syntactic constructs are modeled after various aspects of Visual Basic 6.0 and C++. For example, like VB6, C# supports the notion of formal type properties (as opposed to traditional getter and setter methods) and the ability to declare methods taking varying number of arguments (via parameter arrays). Like C++, C# allows you to overload operators, as well as to create structures, enumerations, and callback functions (via delegates). Due to the fact that C# is a hybrid of numerous languages, the result is a product that is as syntactically clean if not cleaner than Java, is about as simple as VB6, and provides just about as much power and flexibility as C++ (without the associated ugly bits). In a nutshell, the C# language offers the following features (many of which are shared by other .NET-aware programming languages): No pointers required! C# programs typically have no need for direct pointer manipulation (although you are free to drop down to that level if absolutely necessary). Automatic memory management through garbage collection. Given this, C# does not support a delete keyword. Formal syntactic constructs for enumerations, structures, and class properties. The C++-like ability to overload operators for a custom type, without the complexity (e.g., making sure to return *this to allow chaining is not your problem). As of C# 2005, the ability to build generic types and generic members using a syntax very similar to C++ templates. Full support for interface-based programming techniques. Full support for aspect-oriented programming (AOP) techniques via attributes. This brand of development allows you to assign characteristics to types and their members to further qualify their behavior. Perhaps the most important point to understand about the C# language shipped with the Microsoft .NET platform is that it can only produce code that can execute within the .NET runtime (you could never use C# to build a native COM server or a unmanaged Win32 API application). Officially speaking, the term used to describe the code targeting the .NET runtime is managed code. The binary unit that contains the managed code is termed an assembly (more details on assemblies in just a bit). Conversely, code that cannot be directly hosted by the .NET runtime is termed unmanaged code. Additional .NET-Aware Programming Languages Understand that C# is not the only language targeting the .NET platform. When the .NET platform was first revealed to the general public during the 2000 Microsoft Professional Developers Conference (PDC), several vendors announced they were busy building .NET-aware versions of their respective compilers. At the time of this writing, dozens of different languages have undergone .NET enlightenment. In addition to the five languages that ship with Visual Studio 2005 (C#, J#, Visual Basic .NET, Managed Extensions for C++, and JScript .NET), there are .NET compilers for Smalltalk, COBOL, and Pascal (to name a few). Although this book focuses (almost) exclusively on C#, Table 1-1 lists a number of .NET-enabled programming languages and where to learn more about them (do note that these URLs are subject to change).
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

CHAPTER 1 THE PHILOSOPHY OF .NET 7 (Submit web site)

Thursday, January 3rd, 2008

CHAPTER 1 THE PHILOSOPHY OF .NET 7 Understand that a given .NET-aware language might not support each and every feature defined by the CTS. The Common Language Specification (CLS) is a related specification that defines a subset of common types and programming constructs that all .NET programming languages can agree on. Thus, if you build .NET types that only expose CLS-compliant features, you can rest assured that all .NET-aware languages can consume them. Conversely, if you make use of a data type or programming construct that is outside of the bounds of the CLS, you cannot guarantee that every .NET programming language can interact with your .NET code library. The Role of the Base Class Libraries In addition to the CLR and CTS/CLS specifications, the .NET platform provides a base class library that is available to all .NET programming languages. Not only does this base class library encapsulate various primitives such as threads, file input/output (I/O), graphical rendering, and interaction with various external hardware devices, but it also provides support for a number of services required by most real-world applications. For example, the base class libraries define types that facilitate database access, XML manipulation, programmatic security, and the construction of web-enabled (as well as traditional desktop and console-based) front ends. From a high level, you can visualize the relationship between the CLR, CTS, CLS, and the base class library, as shown in Figure 1-1. Figure 1-1. The CLR, CTS, CLS, and base class library relationship What C# Brings to the Table Given that .NET is such a radical departure from previous technologies, Microsoft has developed a new programming language, C# (pronounced see sharp ), specifically for this new platform. C# is a programming language that looks very similar (but not identical) to the syntax of Java. However, to call C# a Java rip-off is inaccurate. Both C# and Java are based on the syntactical constructs of C++. Just as Java is in many ways a cleaned-up version of C++, C# can be viewed as a cleaned-up version of Java after all, they are all in the same family of languages.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

6 CHAPTER (Web server hosting) 1 THE PHILOSOPHY OF .NET

Wednesday, January 2nd, 2008

6 CHAPTER 1 THE PHILOSOPHY OF .NET The .NET Solution So much for the brief history lesson. The bottom line is that life as aWindows programmer has been tough. The .NET Framework is a rather radical and brute-force approach to making our lives easier. The solution proposed by .NET is Change everything (sorry, you can t blame the messenger for the message). As you will see during the remainder of this book, the .NET Framework is a completely new model for building systems on the Windows family of operating systems, as well as on numerous non-Microsoft operating systems such as Mac OS X and various Unix/Linux distributions. To set the stage, here is a quick rundown of some core features provided courtesy of .NET: Full interoperability with existing code: This is (of course) a good thing. Existing COM binaries can commingle (i.e., interop) with newer .NET binaries and vice versa. Also, Platform Invocation Services (PInvoke) allows you to call C-based libraries (including the underlying API of the operating system) from .NET code. Complete and total language integration: Unlike COM, .NET supports cross-language inheritance, cross-language exception handling, and cross-language debugging. A common runtime engine shared by all .NET-aware languages: One aspect of this engine is a well-defined set of types that each .NET-aware language understands. A base class library: This library provides shelter from the complexities of raw API calls and offers a consistent object model used by all .NET-aware languages. No more COM plumbing: IClassFactory, IUnknown, IDispatch, IDL code, and the evil VARIANTcompliant data types (BSTR, SAFEARRAY, and so forth) have no place in a native .NET binary. A truly simplified deployment model: Under .NET, there is no need to register a binary unit into the system registry. Furthermore, .NET allows multiple versions of the same *.dll to exist in harmony on a single machine. As you can most likely gather from the previous bullet points, the .NET platform has nothing to do with COM (beyond the fact that both frameworks originated from Microsoft). In fact, the only way .NET and COM types can interact with each other is using the interoperability layer. Note Coverage of the .NET interoperability layer (including PInvoke) is beyond the scope of this book. If you require a detailed treatment of these topics, check out my book COM and .NET Interoperability (Apress, 2002). Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS) Now that you know some of the benefits provided by .NET, let s preview three key (and interrelated) entities that make it all possible: the CLR, CTS, and CLS. From a programmer s point of view, .NET can be understood as a new runtime environment and a comprehensive base class library. The runtime layer is properly referred to as the common language runtime, or CLR. The primary role of the CLR is to locate, load, and manage .NET types on your behalf. The CLR also takes care of a number of low-level details such as memory management and performing security checks. Another building block of the .NET platform is the Common Type System, or CTS. The CTS specification fully describes all possible data types and programming constructs supported by the runtime, specifies how these entities can interact with each other, and details how they are represented in the .NET metadata format (more information on metadata later in this chapter).
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

CHAPTER 1 THE PHILOSOPHY OF .NET 5 (Web hosting script)

Tuesday, January 1st, 2008

CHAPTER 1 THE PHILOSOPHY OF .NET 5 approach for such programs would be to use a lower-level language (such as C++) where appropriate. Alas, while Java does provide a limited ability to access non-Java APIs, there is little support for true cross-language integration. Life As a COM Programmer The Component Object Model (COM) was Microsoft s previous application development framework. COM is an architecture that says in effect, If you build your classes in accordance with the rules of COM, you end up with a block of reusable binary code. The beauty of a binary COM server is that it can be accessed in a language-independent manner. Thus, C++ programmers can build COM classes that can be used by VB6. Delphi programmers can use COM classes built using C, and so forth. However, as you may be aware, COM s language independence is somewhat limited. For example, there is no way to derive a new COM class using an existing COM class (as COM has no support for classical inheritance). Rather, you must make use of the more cumbersome has-a relationship to reuse COM class types. Another benefit of COM is its location-transparent nature. Using constructs such as application identifiers (AppIDs), stubs, proxies, and the COM runtime environment, programmers can avoid the need to work with raw sockets, RPC calls, and other low-level details. For example, consider the following VB6 COM client code: ‘ This block of VB6 code can activate a COM class written in ‘ any COM-aware language, which may be located anywhere ‘ on the network (including your local machine). Dim c as MyCOMClass Set c = New MyCOMClass ‘ Location resolved using AppID. c.DoSomeWork Although COM can be considered a very successful object model, it is extremely complex under the hood (at least until you have spent many months exploring its plumbing especially if you happen to be a C++ programmer). To help simplify the development of COM binaries, numerous COM-aware frameworks have come into existence. For example, the Active Template Library (ATL) provides another set of C++ classes, templates, and macros to ease the creation of COM types. Many other languages also hide a good part of the COM infrastructure from view. However, language support alone is not enough to hide the complexity of COM. Even when you choose a relatively simply COM-aware language such as VB6, you are still forced to contend with fragile registration entries and numerous deployment-related issues (collectively termed DLL hell). Life As a Windows DNA Programmer To further complicate matters, there is a little thing called the Internet. Over the last several years, Microsoft has been adding more Internet-aware features into its family of operating systems and products. Sadly, building a web application using COM-based Windows Distributed interNet Applications Architecture (DNA) is also quite complex. Some of this complexity is due to the simple fact that Windows DNA requires the use of numerous technologies and languages (ASP, HTML, XML, JavaScript, VBScript, and COM(+), as well as a data access API such as ADO). One problem is that many of these technologies are completely unrelated from a syntactic point of view. For example, JavaScript has a syntax much like C, while VBScript is a subset of VB6. The COM servers that are created to run under the COM+ runtime have an entirely different look and feel from the ASP pages that invoke them. The result is a highly confused mishmash of technologies. Furthermore, and perhaps more important, each language and/or technology has its own type system (that may look nothing like another s type system). An int in JavaScript is not quite the same as an Integer in VB6.
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.