OOP Class1

esse quam videri
Revision as of 22:35, 6 January 2006 by Jeff (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

About Class

Technologies

  • .NET
  • C#

Servers

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

   * 10.0.0.9 local IP interactive.colum.edu
   * 206.222.52.9 public DSL IP
   * 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 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. Interpreted languages 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 interpreted and add extra 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

  • javascript - ECMA script
  • VBScript - Microsoft scripting version of Visual Basic


Common Server Side Languages

  • PHP (recursive acronym for "PHP: Hypertext Preprocessor")
  • ASP Active server Pages users jscript or vbscript


HelloWorld in several common programming 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

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>