English:
With traditional object-oriented development, extending classes is typically achieved by deriving from a base class and enhancing the functionality in the derived class. Visual BasicR still supports these object-oriented concepts, but classes are sometimes marked NotInheritable to prevent modification of their behavior through inheritance. As a result, there is no way to customize these classes. An example of this is the System.String class.
A new feature made available in Visual Basic 2008, however, lets you extend any existing type's functionality, even when a type is not inheritable. And these extension methods play a crucial role in the implementation of LINQ.
http://msdn.microsoft.com/msdnmag/issues/07/11/BasicInstincts/default.aspx?loc=en
繁體中文:
在傳統的物件導向開發架構中,類別的延伸通常涉及以基底類別進行衍生,然後在衍生類別中增強功能。Visual Basic 依然支援這些物件導向的概念,但是類別有時候會標示為 NotInheritable,以防止其行為透過繼承而被修改。於是便沒有自訂類別的方法。如此的範例包括 System.String 類別。
但是,在 Visual Basic 2008 中的新功能,可以讓您延伸任何現有型別的功能,即使該型別為不可繼承的型別。而且這些延伸方法在 LINQ 的實作過程中擔任著關鍵的角色。
許多現有的型別都無法在不中斷現有程式碼的情況下輕易更新。如此的範例包括 IEnumerable(Of T) 介面。為了要支援 LINQ,介面中必須加入新的方法,但是加入新的方法對於介面的改變卻會中斷現有消費者的相容性。加入新的介面也是一個可能性,但是建立新的介面來補充現有的 IEnumerable(Of T) 介面,在設計上會變得奇怪。
此情況所需的是延伸現有型別的方法,讓型別可以在不變更現有合約的前提下新增功能。
http://msdn.microsoft.com/msdnmag/issues/07/11/BasicInstincts/default.aspx?loc=zx
2007年11月24日星期六
Visual Studio 2008 and .NET Framework 3.5 released!!!

就如原定日期,VS2008終於推出~官方網頁亦更新了,Express版官網使用黑色設計,很神秘的感覺^^
同樣有三大版本 : Professional / Standard / Express
最關心的肯定就是免費且可商業用的Express版本,除了基本VisualBasic / C# / C++ / Visual Web Developer 外,VS2008還多了一個叫Popfly的東西.
對我來說,除了WPF,LinQ外,最想試試VWD整合Expression Web後是如何~Microsoft亦很好地整了一個All-in-One DVD ISO,不用分開下載和安裝了~
Visual Studio Home
http://msdn2.microsoft.com/en-us/vstudio/products/default.aspx
Visual Studio 2008 Express Home
http://www.microsoft.com/express/default.aspx
Download the Visual Studio 2008 Express Edition All-in-One DVD
http://www.microsoft.com/express/download/offline.aspx
Resource:
An Overview of Microsoft Visual Studio 2008 White Paper
Visual Studio 2008 and .NET Framework 3.5 Training Kit
Get up to speed on Visual Studio 2008
Visual C# 2008 Keybinding Reference Poster
.NET Framework 3.5 Common Namespaces and Types Poster
Labels:
.NET Framework,
ASP.NET,
C#,
Visual Basic
訂閱:
文章 (Atom)