Difference between revisions of "OOP Class1"

esse quam videri
Jump to: navigation, search
(Introduction to DotNet)
(Introduction to DotNet)
Line 51: Line 51:
 
.Net is new platform form Microsoft. It consists of several components. The base of the new platform is the .net framework. The .net framework sits on top of the windows(or other) operating system. The .net framework consists of the Common Language Runtime(CLR) and the Framework Class Library(FCL). The CLR is a platform for compiling, debugging and executing .NET applications. Like java the CLR a virtual machine that can better control runtime security, memory management, and threading.
 
.Net is new platform form Microsoft. It consists of several components. The base of the new platform is the .net framework. The .net framework sits on top of the windows(or other) operating system. The .net framework consists of the Common Language Runtime(CLR) and the Framework Class Library(FCL). The CLR is a platform for compiling, debugging and executing .NET applications. Like java the CLR a virtual machine that can better control runtime security, memory management, and threading.
 
Frame work examples
 
Frame work examples
System Contains fundamental classes and base classes that define commonly used value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions.
+
*System Contains fundamental classes and base classes that define commonly used value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions.
System.Data Consists mostly of the classes that constitute the ADO.NET architecture. The ADO.NET architecture enables you to build components that efficiently manage data from multiple data sources. In a disconnected scenario (such as the Internet), ADO.NET provides the tools to request, update, and reconcile data in multiple tier systems. The ADO.NET architecture is also implemented in client applications, such as Windows Forms, or HTML pages created by ASP.NET.
+
*System.Data Consists mostly of the classes that constitute the ADO.NET architecture. The ADO.NET architecture enables you to build components that efficiently manage data from multiple data sources. In a disconnected scenario (such as the Internet), ADO.NET provides the tools to request, update, and reconcile data in multiple tier systems. The ADO.NET architecture is also implemented in client applications, such as Windows Forms, or HTML pages created by ASP.NET.
System.Data.Common Contains classes shared by the .NET Framework data providers. A .NET Framework data provider describes a collection of classes used to access a data source, such as a database, in the managed space.
+
*System.Data.Common Contains classes shared by the .NET Framework data providers. A .NET Framework data provider describes a collection of classes used to access a data source, such as a database, in the managed space.
System.Data.SqlClient Encapsulates the .NET Framework Data Provider for SQL Server. The .NET Framework Data Provider for SQL Server describes a collection of classes used to access a SQL Server database in the managed space.
+
*System.Data.SqlClient Encapsulates the .NET Framework Data Provider for SQL Server. The .NET Framework Data Provider for SQL Server describes a collection of classes used to access a SQL Server database in the managed space.
System.Drawing Provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the
+
*System.Drawing Provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the
System.Drawing.Drawing2D Provides advanced 2-dimensional and vector graphics functionality. This namespace includes the gradient brushes, the Matrix class (used to define geometric transforms), and the GraphicsPath class.
+
*System.Drawing.Drawing2D Provides advanced 2-dimensional and vector graphics functionality. This namespace includes the gradient brushes, the Matrix class (used to define geometric transforms), and the GraphicsPath class.
System.Drawing.Imaging Provides advanced GDI+ imaging functionality. Basic graphics functionality is provided by the System.Drawing namespace.
+
*System.Drawing.Imaging Provides advanced GDI+ imaging functionality. Basic graphics functionality is provided by the System.Drawing namespace.
System.Web Supplies classes and interfaces that enable browser-server communication.
+
*System.Web Supplies classes and interfaces that enable browser-server communication.
System.Web.UI Provides classes and interfaces that allow you to create controls and pages that will appear in your Web applications as user interface on a Web page.
+
*System.Web.UI Provides classes and interfaces that allow you to create controls and pages that will appear in your Web applications as user interface on a Web page.
 
System.Web.UI.HtmlControls Consists of a collection of classes that allow you to create HTML server controls on a Web Forms page. HTML server controls run on the server and map directly to standard HTML tags supported by most browsers. This allows you to programmatically control the HTML elements on a Web Forms page.
 
System.Web.UI.HtmlControls Consists of a collection of classes that allow you to create HTML server controls on a Web Forms page. HTML server controls run on the server and map directly to standard HTML tags supported by most browsers. This allows you to programmatically control the HTML elements on a Web Forms page.
System.Web.UI.WebControls Contains classes that allow you to create Web server controls on a Web page. Web server controls run on the server and include form controls such as buttons and text boxes. They also include special purpose controls such as a calendar. Because Web server controls run on the server, you can programmatically control these elements. Web server controls are more abstract than HTML server controls. Their object model does not necessarily reflect HTML syntax.
+
*System.Web.UI.WebControls Contains classes that allow you to create Web server controls on a Web page. Web server controls run on the server and include form controls such as buttons and text boxes. They also include special purpose controls such as a calendar. Because Web server controls run on the server, you can programmatically control these elements. Web server controls are more abstract than HTML server controls. Their object model does not necessarily reflect HTML syntax.
System.Windows.Forms Contains classes that support design-time configuration and behavior for Windows Forms components.
+
*System.Windows.Forms Contains classes that support design-time configuration and behavior for Windows Forms components.
Full List with descriptions
+
Full List with descriptions http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/cpref_start.asp
  
 
Unlike Java the Microsoft CLR supports multiple languages.
 
Unlike Java the Microsoft CLR supports multiple languages.
Line 80: Line 80:
 
The CLR compiles the .NET languages into MS Intermediate Language (MSIL) which is similar to java's object code. It is an intermediary step between programming language and machine code. The MSIL allows .NET to support multiple programming languages. MSIL code is further compiled by the CLR at run time into machine code. This is known as JIT compilation or Just In Time.
 
The CLR compiles the .NET languages into MS Intermediate Language (MSIL) which is similar to java's object code. It is an intermediary step between programming language and machine code. The MSIL allows .NET to support multiple programming languages. MSIL code is further compiled by the CLR at run time into machine code. This is known as JIT compilation or Just In Time.
 
c#
 
c#
<csharp>
+
<csharp>class HelloWorld {
class HelloWorld {
 
 
     public static void Main() {
 
     public static void Main() {
 
             Console.WriteLine("Hello World!");
 
             Console.WriteLine("Hello World!");
 
              
 
              
 
     }
 
     }
}
+
}</csharp>
</csharp>
 
  
 
MSIL
 
MSIL
<csharp>
+
<csharp>.method public hidebysig static void  Main() cil managed
    .method public hidebysig static void  Main() cil managed
 
 
{
 
{
 
   .entrypoint
 
   .entrypoint

Revision as of 23:51, 8 January 2006

About Class

Technologies

  • .NET
  • C#

Servers

Siam Win2003 ASP.NET Version:v2.0.50727 interactive.colum.edu All students have and account on SERVERIMM and 1.2 GB of space. Keep all of your work for class on SIAM

   * 10.0.0.9 local IP interactive.colum.edu
   * 206.69.162.169 public columbia IP interactive.colum.edu

if you edit your hosts file then you can refer to the servers by name OOP Edit hosts file

Introduction to .NET and C#

Introduction to DotNet

Compliled vs Interpreted Languages
Interpreted Languages

Interpreted langauges read and parse the source input every time a they are executed. After each line is parsed it is converted to machine language and it is executed. Interperted languages are often referd to as scripting languages and are often good for small projects that need to be deployed quickly.

Interperated Scripting Languages are often used on the web

Common Interpreted Languages are Perl,PHP, Python and Ruby

Compiled Languages
Compiled languages use a complier to read and parse the input source code and convert it into machine language. The output binary file is then excuted. If the source changes the program needs to be recompiled. Complied prorams often execute faster and add extra layer of security becuase the source is not always readily available and executable. Complied code also tends to take up less memory and system resources.
Common Client Side


Common Server Side Languages


HelloWorld in several common programming languages Hello World Languages Why .NET? What is .NET?

.Net is new platform form Microsoft. It consists of several components. The base of the new platform is the .net framework. The .net framework sits on top of the windows(or other) operating system. The .net framework consists of the Common Language Runtime(CLR) and the Framework Class Library(FCL). The CLR is a platform for compiling, debugging and executing .NET applications. Like java the CLR a virtual machine that can better control runtime security, memory management, and threading. Frame work examples

  • System Contains fundamental classes and base classes that define commonly used value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions.
  • System.Data Consists mostly of the classes that constitute the ADO.NET architecture. The ADO.NET architecture enables you to build components that efficiently manage data from multiple data sources. In a disconnected scenario (such as the Internet), ADO.NET provides the tools to request, update, and reconcile data in multiple tier systems. The ADO.NET architecture is also implemented in client applications, such as Windows Forms, or HTML pages created by ASP.NET.
  • System.Data.Common Contains classes shared by the .NET Framework data providers. A .NET Framework data provider describes a collection of classes used to access a data source, such as a database, in the managed space.
  • System.Data.SqlClient Encapsulates the .NET Framework Data Provider for SQL Server. The .NET Framework Data Provider for SQL Server describes a collection of classes used to access a SQL Server database in the managed space.
  • System.Drawing Provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the
  • System.Drawing.Drawing2D Provides advanced 2-dimensional and vector graphics functionality. This namespace includes the gradient brushes, the Matrix class (used to define geometric transforms), and the GraphicsPath class.
  • System.Drawing.Imaging Provides advanced GDI+ imaging functionality. Basic graphics functionality is provided by the System.Drawing namespace.
  • System.Web Supplies classes and interfaces that enable browser-server communication.
  • System.Web.UI Provides classes and interfaces that allow you to create controls and pages that will appear in your Web applications as user interface on a Web page.

System.Web.UI.HtmlControls Consists of a collection of classes that allow you to create HTML server controls on a Web Forms page. HTML server controls run on the server and map directly to standard HTML tags supported by most browsers. This allows you to programmatically control the HTML elements on a Web Forms page.

  • System.Web.UI.WebControls Contains classes that allow you to create Web server controls on a Web page. Web server controls run on the server and include form controls such as buttons and text boxes. They also include special purpose controls such as a calendar. Because Web server controls run on the server, you can programmatically control these elements. Web server controls are more abstract than HTML server controls. Their object model does not necessarily reflect HTML syntax.
  • System.Windows.Forms Contains classes that support design-time configuration and behavior for Windows Forms components.

Full List with descriptions http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/cpref_start.asp

Unlike Java the Microsoft CLR supports multiple languages.

Sun and microsoft have different programing philosophies. Java write once (in java) run anywhere. CLR write in any CLR language and run on .NET The CLR from Microsoft supports several languages.

   * C# - java like language pronounced C Sharp (the language we will use for this course)
   * VB.NET - Visual Basic .NET
   * JScript
   * J# - Microsoft's Java-language
   * third party languages (cobol,eiffel,pascal,perl) Programming Language Partners 

The CLR compiles the .NET languages into MS Intermediate Language (MSIL) which is similar to java's object code. It is an intermediary step between programming language and machine code. The MSIL allows .NET to support multiple programming languages. MSIL code is further compiled by the CLR at run time into machine code. This is known as JIT compilation or Just In Time. c# <csharp>class HelloWorld {

   public static void Main() {
           Console.WriteLine("Hello World!");
           
   }

}</csharp>

MSIL <csharp>.method public hidebysig static void Main() cil managed {

 .entrypoint
 // Code size       11 (0xb)
 .maxstack  1
 IL_0000:  ldstr      "Hello World!"
 IL_0005:  call       void [mscorlib]System.Console::WriteLine(string)
 IL_000a:  ret

} // end of method HelloWorld::Main </csharp> Fully Disassembled hello.cs Other Links ECMA C# and Common Language Infrastructure Standards Mono - Ximian Linux .NET Copy GotDotNet - Microsoft Site to bridge the gap between .NET team and .NET developers/students

.NET Applications

   * Console Applications
   * Windows Forms
   * Web Forms
   * Web Services


Hello world in C# <csharp> using System; namespace HelloClass {

   class HelloWorld
   {
       public static void Main()
       {
               Console.WriteLine("Hello World!");
               
       }
   }

} </csharp>