【正文】
ols than both of those other languages, and it has been designed to give us, simultaneously, the ease of use of Visual Basic, and the high performance, lowlevel memory access of C++ if required. Some of the features of C are: ? Full support for classes and objectoriented programming, including both interface and implementation inheritance, virtual functions, and operator overloading. ? A consistent and welldefined set of basic types. ? Builtin support for automatic generation of XML documentation. ? Automatic cleanup of dynamically allocated memory. ? The facility to mark classes or methods with userdefined attributes. This can be useful for documentation and can have some effects on pilation (for example, marking methods to be piled only in debug builds). ? Full access to the .NET base class library, as well as easy access to the Windows API (if you really need it, which won’t be all that often). ? Pointers and direct memory access are available if required, but the language has been designed in such a way that you can work without them in almost all cases. ? Support for properties and events in the style of Visual Basic. ? Just by changing the piler options, you can pile either to an executable or to a library of .NET ponents that can be called up by other code in the same way as ActiveX controls (COM ponents). ? C can be used to write dynamic Web pages and XMLWeb services. Most of the above statements, it should be pointed out, do also apply to Visual Basic .NET and Managed C++. The fact that C is designed from the start to work with .NET, however, means that its support for the features of .NET is both more plete, and offered within the context of a more suitable syntax than for those other languages. While the C language itself is very similar to Java, there are some improvements: in particular, Java is not designed to work 3 with the .NET environment. Before we leave the subject, we should point out a couple of limitations of C. The one area the language is not designed for is timecritical or extremely high performance code—the kind where you really are worried about whether a loop takes 1,000 or 1,050 machine cycles to run through, and you need to clean up your resources the millisecond they are no longer needed. C++ is likely to continue to reign supreme among lowlevel languages in this area. C lacks certain key facilities needed for extremely high performance apps, including the ability to specify inline functions and destructors that are guaranteed to run at particular points in the code. However, the proportions of applications that fall into this category are very low. 中文: C的優(yōu)點(diǎn) C在某種程度上可以看作是 .NET 面向 Windows 環(huán)境的一種編程語(yǔ)言。在過(guò)去的十幾年里, Microsoft 給 Windows 和 Windows API 添加了許多功能, VB 和 C++也經(jīng)歷了許多變化。 對(duì)于 Visual Basic 來(lái)說(shuō),它的主要優(yōu)點(diǎn)是很容易理解,許多編程工作都很容易完成,基本上隱藏了 Windows API 和 COM 組件結(jié)構(gòu)的內(nèi)涵。另外,因?yàn)?VB 的語(yǔ)法繼承于 BASIC 的早期版本 (BASIC 主要是為了讓初學(xué)者更容易理解,而不是為了編寫大型商業(yè)應(yīng)用程序 ),所以不能真正成為結(jié)構(gòu)化或面向?qū)ο蟮木幊陶Z(yǔ)言。它與 ANSI 不完全兼容,因?yàn)镸icrosoft 是在 ANSI 定義標(biāo)準(zhǔn)化之前編寫 C++編譯器的,但已經(jīng)相當(dāng)接近了。其一, ANSI C++是在十幾年前的技術(shù)條件下開(kāi)發(fā)的,因此不支持現(xiàn)在的概念 (例如 Unicode 字符串和生成 XML 文檔 ),某些古老的語(yǔ)法結(jié)構(gòu)是為以前的編譯器設(shè)計(jì)的 (例如成員函數(shù)的聲明和定義是分開(kāi)的 )。其結(jié)果是在 Windows 中,該語(yǔ)言成為了一種 非常雜亂的語(yǔ)言。 現(xiàn)在進(jìn)入 .NET 時(shí)代 —— 一種全新的環(huán)境,它對(duì)這兩種語(yǔ)言都進(jìn)行了新的擴(kuò)展。在這里, Microsoft 決定給開(kāi)發(fā)人員另一個(gè)選擇 —— 專門用于 .NET、具有新起點(diǎn)的語(yǔ)言, 即 Visual C .NET。大多數(shù)獨(dú)立的評(píng)論員對(duì)其說(shuō)法是 “派生于 C、 4 C++ 和 Java”。從語(yǔ)法上看, C非常類似于 C++和 Java,許多關(guān)鍵字都是相同的, C也使用類似于 C++和 Java的塊結(jié)構(gòu),并用括號(hào) ({} )來(lái)標(biāo)記代碼塊,用分號(hào)分隔各行語(yǔ)句。但在這些表面上的類似性后面, C學(xué)習(xí)起來(lái)要比 C++容易得多,但比 Java 難一些。 C包括以下一些特性: ● 完全支持類和面向?qū)ο缶幊?,包括接口和繼承、虛函數(shù)和運(yùn)算符重載的處理。 ● 對(duì)自動(dòng)生成 XML 文檔說(shuō)明的內(nèi)置支持。 ● 可以用用戶定義的特性來(lái)標(biāo)記類或方法。 ● 對(duì) .NET 基類庫(kù)的完全訪問(wèn)權(quán),并易于訪問(wèn) Windows API。 ● 以 VB 的風(fēng)格支持屬性和事件。 ● C可以用于編寫 動(dòng)態(tài) Web 頁(yè)面和 XML Web 服務(wù)。但 C從一開(kāi)始就使用 .NET, 對(duì) .NET 特性的支持不僅是完整的,而且提供了比其他語(yǔ)言更合適的語(yǔ)法。 在結(jié)束這個(gè)主題前,還要指出 C的兩個(gè)局限性。在這方面, C++可能仍是所有低級(jí)語(yǔ)言中的佼佼者。但這類應(yīng)用 程序非常少。s own programming language. That is not the same as users who create and manage personal files that are not part of the mainstream pany system. Transaction Management of Database The objective of longduration transactions is to model longduration, interactive Database access sessions in application environments. The fundamental assumption about shortduration of transactions that underlies the traditional model of transactions is inappropriate for 7 longduration transactions. The implementation of the traditional model of transactions may cause intolerably long waits when transactions aleph to acquire locks before accessing data, and may also cause a large amount of work to be lost when transactions are backed out in response to userinitiated aborts or system failure situations. The objective of a transaction model is to provide a rigorous basis for automatically enforcing criterion for database consistency for a set of multiple concurrent read and write accesses to the database in the presence of potential system failure situations. The consistency criterion adopted for traditional transactions is the notion of scrializability. Scrializability is enforced in conventional database systems through the use of locking for automatic concurrency control, and logging for automatic recovery from system failure situations. A “transaction” that doesn’t provide a basis for automatically enforcing database consistency is not really a transaction. To be sure, a longduration transaction need not adopt serializability as its consistency criterion. However, there must be some consistcricy criterion. Version System Management of Database Despite a large number of proposals on version support in the context of puter aided design and software engineering, the absence of a consensus on version semantics has been a key impediment to version support in database systems. Because of the differences between files and databases, it is intuitively clear that the model of versions in database systems cannot be as simple as that adopted in file systems to support s