SlideShare a Scribd company logo
Winson Sun
Survey 听说过 DotNet, C#  ( 1 ) 知道什么是 C#, DotNet  Framework ( 2 ) 知道如何命令行编译 C#  ( 1 ) 编写过 C# 程序 ( 2 ) 知道什么是 CLR  ( 2 ) 知道什么是 Rails , ASP.NET MVC  ( 2 ) 知道什么是 Ruby, Python (1) 知道什么是 GC , LINQ  ( 2 ) Write WCF service/client example Write SilverLight/WPF example with plain mode, with MVVM pattern Investigate the source code of Dotnet (with VS debug or ILSpy) Familiar with useful tools for DotNet development Familiar with all DotNet keyword/concept (new features) and could use main parts 知道什么是 Functional Programming , Lambda  ( 3 ) 知道什么是 UI Automation MSTest MSBuild  ( 2 ) 知道什么是 Dynamic language in DotNet  ( 2 )
Survey Do you love programming? Do you plan your job routine? How to become a kaopu developer How to improve yourself continuously Familiar with useful Design pattern Be able to analyse the business requirement, and convert them to software design Could (use tools) find root cause quickly and correctly, could fix issue without adding new bugs
Quiz  Is DotNet framework a real framework? “ Conversion over Configuration”?
What’s Framework? http://en.wikipedia.org/wiki/Software_framework Framework is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality.  Frameworks are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined  API , yet they contain some key distinguishing features that separate them from normal libraries. Frameworks have these distinguishing features that separate them from libraries or normal user applications: 1.  inversion of control  - In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework. 2.  default behavior  - A framework has a default behavior. This default behavior must actually be some useful behavior and not a series of no-ops. 3.  extensibility  - A framework can be extended by the user usually by selective overriding or specialized by user code providing specific functionality 4.  non-modifiable framework code  - The framework code, in general, is not allowed to be modified. Users can extend the framework, but not modify its code.
http://msdn.microsoft.com/zh-cn/netframework/default.aspx DotNet FAQ http://msdn.microsoft.com/en-us/library/ms973850.aspx
COM  VisualStudio.Net  Ado.Net  Windows.Net ASP.NET,  微软你该找个起名大师了! Information , Service, Communication, Connection, too many BIG concepts ! 新瓶装旧酒。 MVC 哪一年提出的概念? Garbage Collection 哪一年? FP 哪一年?(参考 Wiki ) 从务虚到务实
 
http://java.sun.com/javase/6/docs/
 
 
 
 
Quiz What is DotNet Framework? Why Microsoft design the DotNet? Why Microsoft didn’t use DotNet in OS? Why design C#? Why not C++?
 
http://channel9.msdn.com/tags/
Quiz Why we need to learn and use DotNet?
The common language runtime (CLR) is the execution engine for .NET Framework applications. It provides a number of services, including the following:  Code management (loading and execution) Application memory isolation Verification of type safety Conversion of IL to native code Access to metadata (enhanced type information) Managing memory for managed objects Enforcement of code access security Exception handling, including cross-language exceptions Interoperation between managed code, COM objects, and pre-existing DLLs (unmanaged code and data) Automation of object layout Support for developer services (profiling, debugging, and so on)
MSDN .NET Framework http://msdn.microsoft.com/en-us/library/system.io%28VS.100%29.aspx http://en.wikipedia.org/wiki/.NET_Framework http://zh.wikipedia.org/wiki/.NET%E6%A1%86%E6%9E%B6 http://msdn.microsoft.com/zh-cn/library/w0x726c2%28v=vs.90%29.aspx
.NET Framework Class Library The .NET Framework class library is a library of classes, interfaces, and value types that provides access to system functionality and is designed to be the foundation on which .NET Framework applications, components, and controls are built.
The  Base Class Library  (BCL) includes a small subset of the entire class library and is the core set of classes that serve as the basic  API  of the  Common Language Runtime . [9]  The classes in  mscorlib.dll  and some of the classes in  System.dll  and  System.core.dll  are considered to be a part of the BCL. The BCL classes are available in both .NET Framework as well as its alternative implementations including  .NET Compact Framework ,  Microsoft Silverlight  and  Mono . The  Framework Class Library  (FCL) is a superset of the BCL classes and refers to the entire class library that ships with .NET Framework. It includes an expanded set of libraries, including  WinForms ,  ADO.NET ,  ASP.NET ,  Language Integrated Query ,  WPF ,  WCF  among others. The FCL is much larger in scope than standard libraries for languages like  C++ , and comparable in scope to the  standard libraries of Java .
using System;  using System.IO; namespace ConsoleApplication1 { class Program { public static long DirSize(DirectoryInfo d) { long Size = 0;   FileInfo[] fis = d.GetFiles(); foreach (FileInfo fi in fis) { Size += fi.Length; } DirectoryInfo[] dis = d.GetDirectories(); foreach (DirectoryInfo di in dis) { Size += DirSize(di); } return (Size); } static void Main(string[] args) { System.String dirName = "c:\\temp"; DirectoryInfo d =  new DirectoryInfo(dirName); Console.WriteLine("The size of {0} and its subdirectories is {1} bytes.", d, DirSize(d)); } } }
import java.io.*; import java.util.*; public class DirUtils { public static List recurseDir(String dir) { String result, _result[]; result = RecurseDirFrom(dir); _result = result.split(&quot;\\|&quot;); return Arrays.asList(_result); } private static String RecurseDirFrom(String dirItem) { File file; String list[], result; result = dirItem; file = new File(dirItem); if ( file.isDirectory( )) { list = file.list(); for (int i = 0; i < list.length; i++) result = result + &quot;|&quot; + RecurseDirFrom(dirItem + File.separatorChar + list[i]); } return result; } public static void main(String arg[]) { if (arg.length > 0) { System.out.println(&quot;recursive Dirs from &quot; + arg[0]); System.out.println( DirUtils.recurseDir(arg[0]) ); } } }
Best practice 处理异常的最佳做法 开发全球通用应用程序的最佳做法 System.Net  类的最佳做法 托管线程处理的最佳做法 http://msdn.microsoft.com/zh-cn/library/ms184411%28v=vs.90%29.aspx
http://1code.codeplex.com/ Are you frustrated by the lack of code samples for a certain programming task?  Have you ever struggled to quickly get started with a technique?  Have you expected someone to write code samples for you based on your requests for free?  Is a one-stop code sample library for all Microsoft development technologies attractive to you? Another material: Google search “ C# cookbook ”
C# Programming Tools http://msdn.microsoft.com/zh-cn/vcsharp/default.aspx  CSharp Development Center http://msdn.microsoft.com/en-us/magazine/cc300497.aspx  Ten Must-Have Tools Every Developer Should Download http://www.codeplex.com http://www.codeproject.com
 
http://www.microsoft.com/china/msdn/events/webcasts/shared/Webcast/MSDNWebCast.aspx
 
http://channel9.msdn.com/tags/CSharp/
http://msdn.microsoft.com/zh-cn/practices/default.aspx
http://code.msdn.microsoft.com/Project/ProjectDirectory.aspx?TagName=C%23
DotNet internal http://mono-project.com/ http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx http://netmassdownloader.codeplex.com Shared Source Common Language Infrastructure 2.0 Release
DotNet Platform vs Java Platform WCF(Odata) vs XMLRPC WPF vs RIA (Flash, Flex, Html5, JavaFx) C# language vs Java language Azure Cloud vs Amazon S3 Team system vs  持续集成 (CI) Win7 vs MacOSX
 
Why we say “platform”? Dynamic language IronPython, IronRuby, Lua Functional Programming Fsharp You need to know more JavaScript ( www.jquery.com ) for asp.net Web development, html, css Front dev, server-side dev, do we need desktop?
http://www.silverlight.net/learn/dynamic-languages/
IronPython Demo Used in: Desktop application, small utility. http://www.ironpython.info/index.php/Contents#Windows_Forms
# http://www.ironpython.info/index.php/Interacting_with_Excel # ref: Excel 2003 VBA Language Reference import clr from System import Array from System import DateTime clr.AddReference(&quot;Microsoft.Office.Interop.Excel&quot;) import Microsoft.Office.Interop.Excel as Excel excel = Excel.ApplicationClass() excel.Visible = True workbook = excel.Workbooks.Add() worksheet = workbook.Worksheets.Add() worksheet.Name = &quot;aaaaa&quot; cell1 = worksheet.Range[&quot;A2&quot;] cell1.Value2 = 42 xlrange = worksheet.Range[&quot;A3&quot;, &quot;b4“] arr1 = Array.CreateInstance(object, 2, 2) arr1[0, 0] = DateTime.Now arr1[0, 1] = 3 arr1[1, 0] = &quot;hi Excel test.&quot; arr1[1, 1] = &quot;hi there!&quot; xlrange.Value2 = arr1
IronRuby Demo Used in: Quick dirty website. Sinatra, Rails ir, igem,
require 'rubygems' require 'sinatra' get '/hi' do &quot;Hello World!“ end get '/hi/:name' do # matches &quot;GET /hello/foo&quot; and &quot;GET /hello/bar&quot; # params[:name] is 'foo' or 'bar‘ &quot;Hello #{params[:name]}! you come from /hi&quot; end
Quiz  Why we should learn and use dynamic language? Which area is suitable for Ruby/Python?
Survey First gets 3, second gets 1, third gets 0, how about your rate? Web develop, DotNet(C#) vs Ruby/Python vs Java Desktop develop, DotNet(C#) vs Ruby/Python vs Java Cross OperationSystem, DotNet(C#) vs Ruby/Python vs Java Embedded (Phone), DotNet(C#) vs Ruby/Python vs Java Game (Server) develop, DotNet(C#) vs Ruby/Python vs Java
A New World – F# Csharp: int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 }; var numQuery = from num in numbers where (num % 2) == 0 select num; foreach (int num in numQuery) {  Console.Write(&quot;{0,1} &quot;, num);  } Fsharp: let listN = List.filter (fun n -> (n % 2) = 0) [0..6];;  printfn &quot;listN = %A&quot; listN http://msdn.microsoft.com/en-us/fsharp/default.aspx
let rec qsort L = match L with | [] -> [] | x::xs ->  let smaller = [for i in xs when i <= x -> i] in let larger = [for i in xs when i > x -> i] in qsort smaller @ [x] @ qsort larger;; qsort [3;5;1;4;2];; qsort [7;5;10;2;3;67;1;3];; qsort [&quot;Hello&quot;; &quot;AA&quot;; &quot;hello&quot;; &quot;help&quot;; &quot;Aa&quot;; &quot;aa&quot;;];; http://www.gofsharp.com/FS/Translations/Hutton/Hutton.txt
Fsharp Demo http://research.microsoft.com/en-us/people/dsyme/ http://www.cnblogs.com/JeffreyZhao/tag/F%23/ ***  Fsharp could do all work that Csharp could ***
Quiz Why we should learn/use Functional language? Which area is suitable for Fsharp? Concurrency?  Parallelism?
Concurrency (Erlang)  and  parallelism  (Fsharp) are  NOT  the same thing. Two tasks T1 and T2 are concurrent if the order in which the two tasks are executed in time is not predetermined,  T1 may be executed and finished before T2,  T2 may be executed and finished before T1,  T1 and T2 may be executed simultaneously at the same instance of time (parallelism),  T1 and T2 may be executed alternatively,  If two concurrent threads are scheduled by the OS to run on one single-core non-SMT non-CMP processor, you may get concurrency but not parallelism. Parallelism is possible on multi-core, multi-processor or distributed systems. Concurrency  is often referred to as a property of a program, and is a concept more general than  parallelism .
SliverLight more important UIAutomation Test Odata Azure platform ASP.net MVC MVVM
 
Advance topic : Garbage Collection  Garbage Collection useful documents http://www.ibm.com/developerworks/cn/java/j-jtp10283/ http://www.ibm.com/developerworks/cn/java/l-JavaMemoryLeak2/index.html http://blogs.msdn.com/maoni/archive/2004/06/15/156626.aspx http://msdn.microsoft.com/zh-cn/library/0xy59wtx.aspx http://blogs.msdn.com/maoni/archive/2004/06/15/156626.aspx http://blogs.msdn.com/maoni/archive/2004/09/25/234273.aspx http://blogs.msdn.com/maoni/archive/2004/12/19/327149.aspx http://blogs.msdn.com/maoni/archive/2005/05/06/415296.aspx http://www.codeproject.com/KB/dotnet/garbagecollection.aspx http://blogs.msdn.com/tess/archive/2006/09/06/net-memory-usage-a-restaurant-analogy.aspx http://msdn.microsoft.com/en-us/library/ms973837.aspx http://msdn.microsoft.com/en-us/library/f144e03t.aspx
Quiz How to design a garbage collection library?
In DotNet, managed heap concept. http://www.codeguru.com/columns/dotnet/article.php/c6593
GC 常用技术 引用计数 COM , smart pointer Tracing Mark-Compact  此算法結合了“標記 - 清除”和“複製”兩個演算法的優點。也是分兩階段,第一 階段從根節點開始標記所有被引用物件,第二階段遍歷整個 heap ,把清除未標記物件並且把存活物件“壓縮”到 heap 的其中一塊,按順序排放。此演算法避免了“標記 - 清除”的碎片問題,同時也避免了“複製”算法的空間問題。 http://pt.withy.org/publications/AMM.pdf http://www.cs.nctu.edu.tw/~kjji/GC.pptx http://moon.nju.edu.cn/twiki/pub/ICSatNJU/CourseOOT/04_Memory_Management.ppt http://www.cs.wustl.edu/~mdeters/doc/slides/rtgc-history.pdf http://lua-users.org/wiki/GarbageCollectionTutorial http://blog.csdn.net/akara/archive/2010/03/23/5408678.aspx http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29
http://chaoticjava.com/posts/how-does-garbage-collection-work/
Advance topic Add-ins and Extensibility Describes how to develop add-in applications that extend a host application's functionality. Asynchronous Programming Design Patterns Describes two design patterns available in the .NET Framework that are used to run threads separately from the main application thread. Component Authoring for the Design Environment Provides links to information about creating your own components in the .NET Framework, customizing their behavior and display, and creating custom controls for the Windows Presentation Foundation (WPF). Dynamic Source Code Generation and Compilation Discusses the Code Document Object Model (CodeDOM), which enables the output of source code in multiple programming languages. Emitting Dynamic Methods and Assemblies Describes a set of managed types in the  System.Reflection.Emit  namespace that enable a compiler or tool to emit metadata and Microsoft intermediate language (MSIL) at run time and optionally generate a portable executable (PE) file on disk. Expression Trees Introduces expression trees, which are tree-shaped data structures that can be used to represent language-level code in the form of data. Garbage Collection Discusses how the garbage collector manages memory and how you can program to use memory more efficiently. Hosting the Common Language Runtime Explains the concept of a runtime host, which loads the runtime into a process, creates the application domain in the process, and loads and executes user code. Interoperability Describes services provided by the .NET Framework for interaction with COM components, COM+ services, external type libraries, and many operating system services. .NET Remoting Discusses establishing communication between objects that run in different processes. Network Programming Shows how to use Internet access classes to implement both Web- and Internet-based applications. Reflection Explains how to obtain access to type information at run time by using reflection. Reliability Discusses writing reliable code for any host that is executing in a .NET Framework environment. Serialization Discusses the process of converting the state of an object into a form that can be persisted or transported. Managed Threading Explains the runtime support for threading and how to program by using various synchronization techniques. Writing Serviced Components Describes how to configure and register serviced components to access COM+ services.
More questions? MSDN codeproject.com StackOverflow.com CodePlex.com Wikipedia MSDN forum http://www.cnblogs.com google search
DotNet shortcoming YAGNI, too big, too over. 新名词, Oh No ! ORZ ! 技术依赖强烈  Silverlight + WCF 平台及工具 IDE 依赖强烈 学习曲线陡峭 变化剧烈  WinForm or WPF? Remoting or WCF?  大而全?还是大而无当?
重点学习” stable” and “Internal” knowledge ,新技术不过是它们的组合包装 .  RPC, XML, HTTP, Socket, GC, Dynamic language, FP, UnitTest, CLR, API design, Framework design, String code, RE, DataStructure, Algorithm, Web framework pattern 适当了解你需要的 .  DotNet Framework, WCF, WPF, Asp.net, Silverlight 保持对技术的好奇心 使用新版本 ,  Win7 + DotNet4 + VS2010
Learn it, Use it, Share it!

More Related Content

PPTX
Gc algorithm inside_dot_net
PPTX
Net serialization
PDF
Improving DroidBox
PDF
JPA Week3 Entity Mapping / Hexagonal Architecture
PDF
Terraforming
PPT
.NET Overview
PDF
JPA 스터디 Week2 - Object Relational Mapping
PDF
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
Gc algorithm inside_dot_net
Net serialization
Improving DroidBox
JPA Week3 Entity Mapping / Hexagonal Architecture
Terraforming
.NET Overview
JPA 스터디 Week2 - Object Relational Mapping
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?

Viewers also liked (6)

PPTX
Evaluation q1
PPT
Code review
DOC
老友记
DOC
Lua gc代码
PPT
Code quality
PPT
Code rule
Evaluation q1
Code review
老友记
Lua gc代码
Code quality
Code rule
Ad

Similar to Dotnetintroduce 100324201546-phpapp02 (20)

PPT
DotNet Introduction
PPTX
Net Fundamentals
PDF
tybsc it asp.net full unit 1,2,3,4,5,6 notes
PPS
dot NET Framework
PPT
Nakov dot net-framework-overview-english
PPT
Runtime Environment Of .Net Divya Rathore
PPTX
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
PPTX
Some more Concepts of DOT cvcvcvNET.pptx
PPTX
DOT NET Framework.pptxdsfdsfdsfsdfdsfdsfdsf
PPT
Microsoft.Net
PPTX
.Net slid
PPT
Introduction to Visual Studio.NET
PDF
PPT
Visual studio
PDF
Dot NET Interview Questions PDF By ScholarHat
PPT
Csharp dot net
PPTX
.Net framework
PPT
Introdot Netc Sharp En
PPTX
Overview of VS2010 and .NET 4.0
DotNet Introduction
Net Fundamentals
tybsc it asp.net full unit 1,2,3,4,5,6 notes
dot NET Framework
Nakov dot net-framework-overview-english
Runtime Environment Of .Net Divya Rathore
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
Some more Concepts of DOT cvcvcvNET.pptx
DOT NET Framework.pptxdsfdsfdsfsdfdsfdsfdsf
Microsoft.Net
.Net slid
Introduction to Visual Studio.NET
Visual studio
Dot NET Interview Questions PDF By ScholarHat
Csharp dot net
.Net framework
Introdot Netc Sharp En
Overview of VS2010 and .NET 4.0
Ad

More from Wei Sun (14)

PPT
Using google appengine_final2
PPT
Using google appengine_final
PPT
Using google appengine_1027
PPT
Using google appengine (2)
PPT
Python with dot net and vs2010
PPT
Windbg dot net_clr2
PPT
The best way to learn java script
PPT
Asynchronous in dot net4
PPT
Visual studio 11 developer preview
PDF
Using google appengine
PPT
Windbg dot net_clr2
PDF
Web development overview
PPT
Lua
PDF
Mac
Using google appengine_final2
Using google appengine_final
Using google appengine_1027
Using google appengine (2)
Python with dot net and vs2010
Windbg dot net_clr2
The best way to learn java script
Asynchronous in dot net4
Visual studio 11 developer preview
Using google appengine
Windbg dot net_clr2
Web development overview
Lua
Mac

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
August Patch Tuesday
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
1. Introduction to Computer Programming.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
A Presentation on Touch Screen Technology
PPTX
Tartificialntelligence_presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Assigned Numbers - 2025 - Bluetooth® Document
A comparative analysis of optical character recognition models for extracting...
August Patch Tuesday
Accuracy of neural networks in brain wave diagnosis of schizophrenia
MIND Revenue Release Quarter 2 2025 Press Release
1. Introduction to Computer Programming.pptx
DP Operators-handbook-extract for the Mautical Institute
WOOl fibre morphology and structure.pdf for textiles
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A Presentation on Touch Screen Technology
Tartificialntelligence_presentation.pptx
Approach and Philosophy of On baking technology
Hindi spoken digit analysis for native and non-native speakers
SOPHOS-XG Firewall Administrator PPT.pptx
Encapsulation_ Review paper, used for researhc scholars

Dotnetintroduce 100324201546-phpapp02

  • 2. Survey 听说过 DotNet, C# ( 1 ) 知道什么是 C#, DotNet Framework ( 2 ) 知道如何命令行编译 C# ( 1 ) 编写过 C# 程序 ( 2 ) 知道什么是 CLR ( 2 ) 知道什么是 Rails , ASP.NET MVC ( 2 ) 知道什么是 Ruby, Python (1) 知道什么是 GC , LINQ ( 2 ) Write WCF service/client example Write SilverLight/WPF example with plain mode, with MVVM pattern Investigate the source code of Dotnet (with VS debug or ILSpy) Familiar with useful tools for DotNet development Familiar with all DotNet keyword/concept (new features) and could use main parts 知道什么是 Functional Programming , Lambda ( 3 ) 知道什么是 UI Automation MSTest MSBuild ( 2 ) 知道什么是 Dynamic language in DotNet ( 2 )
  • 3. Survey Do you love programming? Do you plan your job routine? How to become a kaopu developer How to improve yourself continuously Familiar with useful Design pattern Be able to analyse the business requirement, and convert them to software design Could (use tools) find root cause quickly and correctly, could fix issue without adding new bugs
  • 4. Quiz Is DotNet framework a real framework? “ Conversion over Configuration”?
  • 5. What’s Framework? http://en.wikipedia.org/wiki/Software_framework Framework is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality. Frameworks are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined API , yet they contain some key distinguishing features that separate them from normal libraries. Frameworks have these distinguishing features that separate them from libraries or normal user applications: 1. inversion of control - In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework. 2. default behavior - A framework has a default behavior. This default behavior must actually be some useful behavior and not a series of no-ops. 3. extensibility - A framework can be extended by the user usually by selective overriding or specialized by user code providing specific functionality 4. non-modifiable framework code - The framework code, in general, is not allowed to be modified. Users can extend the framework, but not modify its code.
  • 6. http://msdn.microsoft.com/zh-cn/netframework/default.aspx DotNet FAQ http://msdn.microsoft.com/en-us/library/ms973850.aspx
  • 7. COM VisualStudio.Net Ado.Net Windows.Net ASP.NET, 微软你该找个起名大师了! Information , Service, Communication, Connection, too many BIG concepts ! 新瓶装旧酒。 MVC 哪一年提出的概念? Garbage Collection 哪一年? FP 哪一年?(参考 Wiki ) 从务虚到务实
  • 8.  
  • 10.  
  • 11.  
  • 12.  
  • 13.  
  • 14. Quiz What is DotNet Framework? Why Microsoft design the DotNet? Why Microsoft didn’t use DotNet in OS? Why design C#? Why not C++?
  • 15.  
  • 17. Quiz Why we need to learn and use DotNet?
  • 18. The common language runtime (CLR) is the execution engine for .NET Framework applications. It provides a number of services, including the following: Code management (loading and execution) Application memory isolation Verification of type safety Conversion of IL to native code Access to metadata (enhanced type information) Managing memory for managed objects Enforcement of code access security Exception handling, including cross-language exceptions Interoperation between managed code, COM objects, and pre-existing DLLs (unmanaged code and data) Automation of object layout Support for developer services (profiling, debugging, and so on)
  • 19. MSDN .NET Framework http://msdn.microsoft.com/en-us/library/system.io%28VS.100%29.aspx http://en.wikipedia.org/wiki/.NET_Framework http://zh.wikipedia.org/wiki/.NET%E6%A1%86%E6%9E%B6 http://msdn.microsoft.com/zh-cn/library/w0x726c2%28v=vs.90%29.aspx
  • 20. .NET Framework Class Library The .NET Framework class library is a library of classes, interfaces, and value types that provides access to system functionality and is designed to be the foundation on which .NET Framework applications, components, and controls are built.
  • 21. The Base Class Library (BCL) includes a small subset of the entire class library and is the core set of classes that serve as the basic API of the Common Language Runtime . [9] The classes in mscorlib.dll and some of the classes in System.dll and System.core.dll are considered to be a part of the BCL. The BCL classes are available in both .NET Framework as well as its alternative implementations including .NET Compact Framework , Microsoft Silverlight and Mono . The Framework Class Library (FCL) is a superset of the BCL classes and refers to the entire class library that ships with .NET Framework. It includes an expanded set of libraries, including WinForms , ADO.NET , ASP.NET , Language Integrated Query , WPF , WCF among others. The FCL is much larger in scope than standard libraries for languages like C++ , and comparable in scope to the standard libraries of Java .
  • 22. using System; using System.IO; namespace ConsoleApplication1 { class Program { public static long DirSize(DirectoryInfo d) { long Size = 0; FileInfo[] fis = d.GetFiles(); foreach (FileInfo fi in fis) { Size += fi.Length; } DirectoryInfo[] dis = d.GetDirectories(); foreach (DirectoryInfo di in dis) { Size += DirSize(di); } return (Size); } static void Main(string[] args) { System.String dirName = &quot;c:\\temp&quot;; DirectoryInfo d = new DirectoryInfo(dirName); Console.WriteLine(&quot;The size of {0} and its subdirectories is {1} bytes.&quot;, d, DirSize(d)); } } }
  • 23. import java.io.*; import java.util.*; public class DirUtils { public static List recurseDir(String dir) { String result, _result[]; result = RecurseDirFrom(dir); _result = result.split(&quot;\\|&quot;); return Arrays.asList(_result); } private static String RecurseDirFrom(String dirItem) { File file; String list[], result; result = dirItem; file = new File(dirItem); if ( file.isDirectory( )) { list = file.list(); for (int i = 0; i < list.length; i++) result = result + &quot;|&quot; + RecurseDirFrom(dirItem + File.separatorChar + list[i]); } return result; } public static void main(String arg[]) { if (arg.length > 0) { System.out.println(&quot;recursive Dirs from &quot; + arg[0]); System.out.println( DirUtils.recurseDir(arg[0]) ); } } }
  • 24. Best practice 处理异常的最佳做法 开发全球通用应用程序的最佳做法 System.Net 类的最佳做法 托管线程处理的最佳做法 http://msdn.microsoft.com/zh-cn/library/ms184411%28v=vs.90%29.aspx
  • 25. http://1code.codeplex.com/ Are you frustrated by the lack of code samples for a certain programming task? Have you ever struggled to quickly get started with a technique? Have you expected someone to write code samples for you based on your requests for free? Is a one-stop code sample library for all Microsoft development technologies attractive to you? Another material: Google search “ C# cookbook ”
  • 26. C# Programming Tools http://msdn.microsoft.com/zh-cn/vcsharp/default.aspx CSharp Development Center http://msdn.microsoft.com/en-us/magazine/cc300497.aspx Ten Must-Have Tools Every Developer Should Download http://www.codeplex.com http://www.codeproject.com
  • 27.  
  • 29.  
  • 33. DotNet internal http://mono-project.com/ http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx http://netmassdownloader.codeplex.com Shared Source Common Language Infrastructure 2.0 Release
  • 34. DotNet Platform vs Java Platform WCF(Odata) vs XMLRPC WPF vs RIA (Flash, Flex, Html5, JavaFx) C# language vs Java language Azure Cloud vs Amazon S3 Team system vs 持续集成 (CI) Win7 vs MacOSX
  • 35.  
  • 36. Why we say “platform”? Dynamic language IronPython, IronRuby, Lua Functional Programming Fsharp You need to know more JavaScript ( www.jquery.com ) for asp.net Web development, html, css Front dev, server-side dev, do we need desktop?
  • 38. IronPython Demo Used in: Desktop application, small utility. http://www.ironpython.info/index.php/Contents#Windows_Forms
  • 39. # http://www.ironpython.info/index.php/Interacting_with_Excel # ref: Excel 2003 VBA Language Reference import clr from System import Array from System import DateTime clr.AddReference(&quot;Microsoft.Office.Interop.Excel&quot;) import Microsoft.Office.Interop.Excel as Excel excel = Excel.ApplicationClass() excel.Visible = True workbook = excel.Workbooks.Add() worksheet = workbook.Worksheets.Add() worksheet.Name = &quot;aaaaa&quot; cell1 = worksheet.Range[&quot;A2&quot;] cell1.Value2 = 42 xlrange = worksheet.Range[&quot;A3&quot;, &quot;b4“] arr1 = Array.CreateInstance(object, 2, 2) arr1[0, 0] = DateTime.Now arr1[0, 1] = 3 arr1[1, 0] = &quot;hi Excel test.&quot; arr1[1, 1] = &quot;hi there!&quot; xlrange.Value2 = arr1
  • 40. IronRuby Demo Used in: Quick dirty website. Sinatra, Rails ir, igem,
  • 41. require 'rubygems' require 'sinatra' get '/hi' do &quot;Hello World!“ end get '/hi/:name' do # matches &quot;GET /hello/foo&quot; and &quot;GET /hello/bar&quot; # params[:name] is 'foo' or 'bar‘ &quot;Hello #{params[:name]}! you come from /hi&quot; end
  • 42. Quiz Why we should learn and use dynamic language? Which area is suitable for Ruby/Python?
  • 43. Survey First gets 3, second gets 1, third gets 0, how about your rate? Web develop, DotNet(C#) vs Ruby/Python vs Java Desktop develop, DotNet(C#) vs Ruby/Python vs Java Cross OperationSystem, DotNet(C#) vs Ruby/Python vs Java Embedded (Phone), DotNet(C#) vs Ruby/Python vs Java Game (Server) develop, DotNet(C#) vs Ruby/Python vs Java
  • 44. A New World – F# Csharp: int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 }; var numQuery = from num in numbers where (num % 2) == 0 select num; foreach (int num in numQuery) { Console.Write(&quot;{0,1} &quot;, num); } Fsharp: let listN = List.filter (fun n -> (n % 2) = 0) [0..6];; printfn &quot;listN = %A&quot; listN http://msdn.microsoft.com/en-us/fsharp/default.aspx
  • 45. let rec qsort L = match L with | [] -> [] | x::xs -> let smaller = [for i in xs when i <= x -> i] in let larger = [for i in xs when i > x -> i] in qsort smaller @ [x] @ qsort larger;; qsort [3;5;1;4;2];; qsort [7;5;10;2;3;67;1;3];; qsort [&quot;Hello&quot;; &quot;AA&quot;; &quot;hello&quot;; &quot;help&quot;; &quot;Aa&quot;; &quot;aa&quot;;];; http://www.gofsharp.com/FS/Translations/Hutton/Hutton.txt
  • 46. Fsharp Demo http://research.microsoft.com/en-us/people/dsyme/ http://www.cnblogs.com/JeffreyZhao/tag/F%23/ *** Fsharp could do all work that Csharp could ***
  • 47. Quiz Why we should learn/use Functional language? Which area is suitable for Fsharp? Concurrency? Parallelism?
  • 48. Concurrency (Erlang) and parallelism (Fsharp) are NOT the same thing. Two tasks T1 and T2 are concurrent if the order in which the two tasks are executed in time is not predetermined, T1 may be executed and finished before T2, T2 may be executed and finished before T1, T1 and T2 may be executed simultaneously at the same instance of time (parallelism), T1 and T2 may be executed alternatively, If two concurrent threads are scheduled by the OS to run on one single-core non-SMT non-CMP processor, you may get concurrency but not parallelism. Parallelism is possible on multi-core, multi-processor or distributed systems. Concurrency is often referred to as a property of a program, and is a concept more general than parallelism .
  • 49. SliverLight more important UIAutomation Test Odata Azure platform ASP.net MVC MVVM
  • 50.  
  • 51. Advance topic : Garbage Collection Garbage Collection useful documents http://www.ibm.com/developerworks/cn/java/j-jtp10283/ http://www.ibm.com/developerworks/cn/java/l-JavaMemoryLeak2/index.html http://blogs.msdn.com/maoni/archive/2004/06/15/156626.aspx http://msdn.microsoft.com/zh-cn/library/0xy59wtx.aspx http://blogs.msdn.com/maoni/archive/2004/06/15/156626.aspx http://blogs.msdn.com/maoni/archive/2004/09/25/234273.aspx http://blogs.msdn.com/maoni/archive/2004/12/19/327149.aspx http://blogs.msdn.com/maoni/archive/2005/05/06/415296.aspx http://www.codeproject.com/KB/dotnet/garbagecollection.aspx http://blogs.msdn.com/tess/archive/2006/09/06/net-memory-usage-a-restaurant-analogy.aspx http://msdn.microsoft.com/en-us/library/ms973837.aspx http://msdn.microsoft.com/en-us/library/f144e03t.aspx
  • 52. Quiz How to design a garbage collection library?
  • 53. In DotNet, managed heap concept. http://www.codeguru.com/columns/dotnet/article.php/c6593
  • 54. GC 常用技术 引用计数 COM , smart pointer Tracing Mark-Compact 此算法結合了“標記 - 清除”和“複製”兩個演算法的優點。也是分兩階段,第一 階段從根節點開始標記所有被引用物件,第二階段遍歷整個 heap ,把清除未標記物件並且把存活物件“壓縮”到 heap 的其中一塊,按順序排放。此演算法避免了“標記 - 清除”的碎片問題,同時也避免了“複製”算法的空間問題。 http://pt.withy.org/publications/AMM.pdf http://www.cs.nctu.edu.tw/~kjji/GC.pptx http://moon.nju.edu.cn/twiki/pub/ICSatNJU/CourseOOT/04_Memory_Management.ppt http://www.cs.wustl.edu/~mdeters/doc/slides/rtgc-history.pdf http://lua-users.org/wiki/GarbageCollectionTutorial http://blog.csdn.net/akara/archive/2010/03/23/5408678.aspx http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29
  • 56. Advance topic Add-ins and Extensibility Describes how to develop add-in applications that extend a host application's functionality. Asynchronous Programming Design Patterns Describes two design patterns available in the .NET Framework that are used to run threads separately from the main application thread. Component Authoring for the Design Environment Provides links to information about creating your own components in the .NET Framework, customizing their behavior and display, and creating custom controls for the Windows Presentation Foundation (WPF). Dynamic Source Code Generation and Compilation Discusses the Code Document Object Model (CodeDOM), which enables the output of source code in multiple programming languages. Emitting Dynamic Methods and Assemblies Describes a set of managed types in the System.Reflection.Emit namespace that enable a compiler or tool to emit metadata and Microsoft intermediate language (MSIL) at run time and optionally generate a portable executable (PE) file on disk. Expression Trees Introduces expression trees, which are tree-shaped data structures that can be used to represent language-level code in the form of data. Garbage Collection Discusses how the garbage collector manages memory and how you can program to use memory more efficiently. Hosting the Common Language Runtime Explains the concept of a runtime host, which loads the runtime into a process, creates the application domain in the process, and loads and executes user code. Interoperability Describes services provided by the .NET Framework for interaction with COM components, COM+ services, external type libraries, and many operating system services. .NET Remoting Discusses establishing communication between objects that run in different processes. Network Programming Shows how to use Internet access classes to implement both Web- and Internet-based applications. Reflection Explains how to obtain access to type information at run time by using reflection. Reliability Discusses writing reliable code for any host that is executing in a .NET Framework environment. Serialization Discusses the process of converting the state of an object into a form that can be persisted or transported. Managed Threading Explains the runtime support for threading and how to program by using various synchronization techniques. Writing Serviced Components Describes how to configure and register serviced components to access COM+ services.
  • 57. More questions? MSDN codeproject.com StackOverflow.com CodePlex.com Wikipedia MSDN forum http://www.cnblogs.com google search
  • 58. DotNet shortcoming YAGNI, too big, too over. 新名词, Oh No ! ORZ ! 技术依赖强烈 Silverlight + WCF 平台及工具 IDE 依赖强烈 学习曲线陡峭 变化剧烈 WinForm or WPF? Remoting or WCF? 大而全?还是大而无当?
  • 59. 重点学习” stable” and “Internal” knowledge ,新技术不过是它们的组合包装 . RPC, XML, HTTP, Socket, GC, Dynamic language, FP, UnitTest, CLR, API design, Framework design, String code, RE, DataStructure, Algorithm, Web framework pattern 适当了解你需要的 . DotNet Framework, WCF, WPF, Asp.net, Silverlight 保持对技术的好奇心 使用新版本 , Win7 + DotNet4 + VS2010
  • 60. Learn it, Use it, Share it!