SlideShare a Scribd company logo
1 of 35
Microsoft .NET
Object Oriented Software Engineering
Based on a presentation
by Murat Can Ganiz
2
Agenda
 .NET
 C#
 .NET vs. J2EE (C# vs. Java)
 Any .NET or C# programmers here?
3
Definition…
 “Microsoft .NET is a set of Microsoft software
technologies for connecting information, people,
systems and devices.”
 Microsoft’s explanation of .NET:
http://www.microsoft.com/net/basics/whatis.asp
 More of an emphasis on web services (self-describing self
modules wrapped in Internet protocols (XML and SOAP)
 In real terms to the developer:
 A new platform for building applications that run in stand-alone
mode or over the Internet
4
Evolution
 Next Generation of COM:
 Component oriented software:
 Win32/C-style APIs are outdated
 COM was step in right direction, but painful to program with
 COM was restricted to VB, C++
 Binary compatibility/portability an issue: x86 version of COM component
needed to be compiled for e.g. PowerPC
 Memory management also a pain
 Common Object Runtime:
 An execution environment for components written in any language:
 Eventually became .NET with incorporation of Web Services
 Standardised API
 Web Services:
 Interoperability is key in the connected world:
 Require open standards for interoperability and leveraging legacy code
5
Architecture
6
.NET Core Components
• FCL is Framework Class Library, comparable to JDK’s library
7
Java and .NET: Runtime environments
 Java
 Intermediate language is bytecode
 Original design targeted interpretation
 Java VMs with JIT compilation are now also used
 .NET Framework
 Intermediate language is MSIL
 Provides JIT compilation
 What is JIT?
 Just-In-Time compilation: translates a bytecode method
into a native method on the fly, so as to remove
the overhead of interpretation
8
Common Language Runtime
 CLR sits on top of OS to provide a virtual environment
for hosting managed applications
 What is CLR similar to in Java?
 Java Virtual Machine (JVM)
 CLR loads modules containing executable and
executes their code
 Code might be managed or unmanaged
 In either case the CLR determines what to do with it
 Managed Code consists of instructions written in a
pseudo-machine language called common
intermediate language, or IL.
 IL instructions are just-in-time (JIT) compiled into
native machine code at run time
9
Compiling and executing managed code
Source
Code
Language
Compiler
Microsoft
Intermediate
Language
(MSIL)
Compilation
JIT
Compiler
Native
Code
The first time each
method is called
Execution
10
Common Language Runtime
C#
12
.NET languages
 Over 20 .NET-compatible languages
 Most are provided by 3rd
parties
 .NET languages provided by Microsoft
 C++
 Visual Basic
 C#
13
Language Compiler List
 AdaAda
 APLAPL
 Basic (Visual Basic)Basic (Visual Basic)
 C#C#
 CC
 C++C++
 JavaJava
 COBOLCOBOL
 Component PascalComponent Pascal
(Queensland U Tech)(Queensland U Tech)
 ECMAScript (JScript)ECMAScript (JScript)
 EiffelEiffel (Monash U.)(Monash U.)
 Haskell (Utrecht U.)Haskell (Utrecht U.)
 lcclcc
(MS Research Redmond)(MS Research Redmond)
 Mondrian (Utrecht)Mondrian (Utrecht)
 MLML
(MS Research Cambridge)(MS Research Cambridge)
 MercuryMercury
(Melbourne U.)(Melbourne U.)
 OberonOberon
(Zurich University)(Zurich University)
 Oz (Univ of Saarlandes)Oz (Univ of Saarlandes)
 PerlPerl
 PythonPython
 Scheme (Northwestern U.)Scheme (Northwestern U.)
 SmallTalkSmallTalk
14
Why C# ?
 Unofficially: because Sun owns Java
 Important features are spread out over multiple
languages
 Example: do you think developers should have to choose
between pointers (C++) or garbage collection (Java)?
 Old languages + new features = poor syntax
 Garbage collection in C++?
 Event-driven GUIs in Java?
 Increase developer productivity!
 Type safety
 Garbage collection
 Exceptions
15
The safety of Java
 100% object oriented
 Automatic garbage collection
 Array bounds checking at runtime
 Strict type checking
 Structured exception handling
16
The ease of Visual Basic
 First class support for properties
 First class support for events
 foreach loops
17
The power of C++
 Enumerations
 Operator overloading
 Mathematical, Indexing, and Casting
 Function pointers
 Called “delegates”
 Type safe
 Structs
18
The power of C++
 Option to pass parameters by reference
or by value
 Can disable type-safety, garbage
collection, and bounds checking
 Can directly manipulate memory with
pointers
19
“foreach” loops
 Iterates over arrays or any class that
implements the IEnumerable interface
 Does this feature look familiar?
 JDK 5.0 imitates, though with different syntax
Int32[] myArray = new Int32[]{10, 20, 30, 40};Int32[] myArray = new Int32[]{10, 20, 30, 40};
foreach(Int32 i in myArray){foreach(Int32 i in myArray){
Console.WriteLine(i);Console.WriteLine(i);
}}
20
Automatic “boxing”
 Automatically converts primitive values to
objects as needed
Stack s = new Stack();Stack s = new Stack();
s.push( 42 );s.push( 42 );
......
int x = (int)s.pop();int x = (int)s.pop();
Stack s = new Stack();Stack s = new Stack();
s.push( new Integer( 42 ) );s.push( new Integer( 42 ) );
......
int x = ((Integer)s.pop()).intValue();int x = ((Integer)s.pop()).intValue();
21
Inheritance and interfaces
 C++ syntax
 Simply use a colon and separate by commas
 Can inherit from one base class
 Can implement any number of interfaces
class ArrayList : Collection, IEnumerableclass ArrayList : Collection, IEnumerable
{{
……
}}
22
Fruit example: class Fruit & constructor
using System;
namespace FruitProject1
{ public abstract class Fruit
{ protected string color;
protected double size;
protected Point center;
/// <summary>
/// Constructor with parameters
/// </summary>
/// <param name="color"></param>
/// <param name="size"></param>
/// <param name="center"></param>
protected Fruit(string color,double size,Point center)
{ MyException ex = new MyException();
if (validColor(color)) this.color = color;
else { ex.whatError = "Invalid color"; throw ex; }
if (validSize(size)) this.size = size;
else { ex.whatError = "Invalid size"; throw ex; }
this.center = center;
}
23
Fruit example: a few Fruit methods
public void changeSize(double size)
{ MyException ex = new MyException();
if (validSize(size)) this.size = size;
else { ex.whatError = "Invalid size"; throw ex; }
}
public double getSize()
{ return size; }
public abstract bool validSize(double size);
public abstract bool validColor(string color);
public abstract void print();
/// <summary>
/// For identifying object types
/// </summary>
/// <returns>Type of the object</returns>
public override string ToString() //Is the keyword a good idea?
{ return "Fruit"; }
24
A couple of methods from class Apple
public override bool validSize(double size)
{ if ((size>500) || (size<10)) return false;
else return true;
}
public override void print()
{ // Automatically invoke ToString methods of object parts
Console.WriteLine("Type:" + this + "- size:" + this.size +
"- color:" + this.color + "- center" + this.center);
}
25
Snippets from class Bowl
using System;
using System.Collections;
namespace FruitProject1
{ /// <summary>
/// class Bowl models a bowl of fruit
/// </summary>
public class Bowl
{ private int capacity;
private ArrayList fruitList = new ArrayList();
public Bowl(int capacity)
{ this.capacity = capacity; }
public int getCapacity() { return capacity; }
public int getNumberofFruits() { return fruitList.Count; }
public bool addFruit(Fruit f)
{ if (fruitList.Count<capacity) fruitList.Add(f);
else return false;
return true;
}
//More methods…
}
.NET vs. J2EE
27
Basic Truths
 J2EE
 Java-centric and platform-neutral
 J2EE is not a product you buy from Sun.
 J2EE is a set of specifications which indicate how
various J2EE functions must interoperate
 If I don’t buy J2EE from Sun, how does Sun make money?
 J2EE 1.4 released with features to completely
support web services – JAX-RPC 1.1 API, J2EE
Management 1.0 API, web service endpoints etc.
(Hard to learn, hard to implement!)
28
Basic Truths
 .NET
 Windows-centric and language-neutral
 .NET is a Microsoft product strategy that includes a
range of products from development tools and
servers to end-user applications.
 Platform-neutral version of .NET is available
Mono –Novell-sponsored, open source
implementation of the .NET development
environment
( http://www.go-mono.com )
29
Typical N-tier application architecture
30
.NET and Java: application platforms
 .NET
 The .NET Framework
 Java
 Java application servers
 Products include:
 IBM WebSphere Application Server
 BEA WebLogic Application Server
 Sun iPlanet Application Server
 Oracle Application Server
 Many others
31
.NET vs. Java: standard libraries
 .NET Framework class library
 Defined by Microsoft
 Somewhat Windows-oriented
 Organized into a hierarchy of namespaces
 J2SE, J2EE
 Defined by Sun and the Java Community Process
 Not bound to any operating system
 Defined as packages and interfaces
32
Class Libraries
33
.NET Class Library
 IO
 GUI Programming
 System Information
 Collections
 Components
 Application Configuration
 Connecting to Databases (ADO.NET)
 Tracing and Logging
 Manipulating Images/Graphics
34
Class Library
 Interoperability with COM
 Globalization and Internationalization
 Network Programming with Sockets
 Remoting
 Serialization
 XML
 Security and Cryptography
 Threading
 Web Services
Thanks…
Questions?
murat@lehigh.edu (Murat Ganiz)
This presentation available at:
www.cse.lehigh.edu/~glennb/oose/Csharp_dotNET.ppt

More Related Content

What's hot

Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?NIIT India
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1sotlsoc
 
Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Sahil Gupta
 
01. Introduction to programming with java
01. Introduction to programming with java01. Introduction to programming with java
01. Introduction to programming with javaIntro C# Book
 
Decorating code (Research Paper)
Decorating code (Research Paper)Decorating code (Research Paper)
Decorating code (Research Paper)Jenna Pederson
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsQUONTRASOLUTIONS
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and TechniquesBala Subra
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of javaCIB Egypt
 

What's hot (20)

Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)
 
Introduction to Programming Lesson 01
Introduction to Programming Lesson 01Introduction to Programming Lesson 01
Introduction to Programming Lesson 01
 
Java swing 1
Java swing 1Java swing 1
Java swing 1
 
01. Introduction to programming with java
01. Introduction to programming with java01. Introduction to programming with java
01. Introduction to programming with java
 
Tutorial c#
Tutorial c#Tutorial c#
Tutorial c#
 
Java essential notes
Java essential notesJava essential notes
Java essential notes
 
JAVA Program Examples
JAVA Program ExamplesJAVA Program Examples
JAVA Program Examples
 
Decorating code (Research Paper)
Decorating code (Research Paper)Decorating code (Research Paper)
Decorating code (Research Paper)
 
Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutions
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
Core Java
Core JavaCore Java
Core Java
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
 
Programming in Java
Programming in JavaProgramming in Java
Programming in Java
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 
C#.NET
C#.NETC#.NET
C#.NET
 

Similar to Csharp dot net

tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 
Introduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsIntroduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsQUONTRASOLUTIONS
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp EnGregory Renard
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEBenjamin Cabé
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programmingmaznabili
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra SolutionsQUONTRASOLUTIONS
 
Presentation1
Presentation1Presentation1
Presentation1kpkcsc
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Wei Sun
 
Whidbey old
Whidbey old Whidbey old
Whidbey old grenaud
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging TechniquesBala Subra
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet IntroductionWei Sun
 

Similar to Csharp dot net (20)

tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
 
Introduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutionsIntroduction to .NET by QuontraSolutions
Introduction to .NET by QuontraSolutions
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp En
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programming
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
Presentation1
Presentation1Presentation1
Presentation1
 
Sadiq786
Sadiq786Sadiq786
Sadiq786
 
Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02Dotnetintroduce 100324201546-phpapp02
Dotnetintroduce 100324201546-phpapp02
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
 

Recently uploaded

Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 

Recently uploaded (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 

Csharp dot net

  • 1. Microsoft .NET Object Oriented Software Engineering Based on a presentation by Murat Can Ganiz
  • 2. 2 Agenda  .NET  C#  .NET vs. J2EE (C# vs. Java)  Any .NET or C# programmers here?
  • 3. 3 Definition…  “Microsoft .NET is a set of Microsoft software technologies for connecting information, people, systems and devices.”  Microsoft’s explanation of .NET: http://www.microsoft.com/net/basics/whatis.asp  More of an emphasis on web services (self-describing self modules wrapped in Internet protocols (XML and SOAP)  In real terms to the developer:  A new platform for building applications that run in stand-alone mode or over the Internet
  • 4. 4 Evolution  Next Generation of COM:  Component oriented software:  Win32/C-style APIs are outdated  COM was step in right direction, but painful to program with  COM was restricted to VB, C++  Binary compatibility/portability an issue: x86 version of COM component needed to be compiled for e.g. PowerPC  Memory management also a pain  Common Object Runtime:  An execution environment for components written in any language:  Eventually became .NET with incorporation of Web Services  Standardised API  Web Services:  Interoperability is key in the connected world:  Require open standards for interoperability and leveraging legacy code
  • 6. 6 .NET Core Components • FCL is Framework Class Library, comparable to JDK’s library
  • 7. 7 Java and .NET: Runtime environments  Java  Intermediate language is bytecode  Original design targeted interpretation  Java VMs with JIT compilation are now also used  .NET Framework  Intermediate language is MSIL  Provides JIT compilation  What is JIT?  Just-In-Time compilation: translates a bytecode method into a native method on the fly, so as to remove the overhead of interpretation
  • 8. 8 Common Language Runtime  CLR sits on top of OS to provide a virtual environment for hosting managed applications  What is CLR similar to in Java?  Java Virtual Machine (JVM)  CLR loads modules containing executable and executes their code  Code might be managed or unmanaged  In either case the CLR determines what to do with it  Managed Code consists of instructions written in a pseudo-machine language called common intermediate language, or IL.  IL instructions are just-in-time (JIT) compiled into native machine code at run time
  • 9. 9 Compiling and executing managed code Source Code Language Compiler Microsoft Intermediate Language (MSIL) Compilation JIT Compiler Native Code The first time each method is called Execution
  • 11. C#
  • 12. 12 .NET languages  Over 20 .NET-compatible languages  Most are provided by 3rd parties  .NET languages provided by Microsoft  C++  Visual Basic  C#
  • 13. 13 Language Compiler List  AdaAda  APLAPL  Basic (Visual Basic)Basic (Visual Basic)  C#C#  CC  C++C++  JavaJava  COBOLCOBOL  Component PascalComponent Pascal (Queensland U Tech)(Queensland U Tech)  ECMAScript (JScript)ECMAScript (JScript)  EiffelEiffel (Monash U.)(Monash U.)  Haskell (Utrecht U.)Haskell (Utrecht U.)  lcclcc (MS Research Redmond)(MS Research Redmond)  Mondrian (Utrecht)Mondrian (Utrecht)  MLML (MS Research Cambridge)(MS Research Cambridge)  MercuryMercury (Melbourne U.)(Melbourne U.)  OberonOberon (Zurich University)(Zurich University)  Oz (Univ of Saarlandes)Oz (Univ of Saarlandes)  PerlPerl  PythonPython  Scheme (Northwestern U.)Scheme (Northwestern U.)  SmallTalkSmallTalk
  • 14. 14 Why C# ?  Unofficially: because Sun owns Java  Important features are spread out over multiple languages  Example: do you think developers should have to choose between pointers (C++) or garbage collection (Java)?  Old languages + new features = poor syntax  Garbage collection in C++?  Event-driven GUIs in Java?  Increase developer productivity!  Type safety  Garbage collection  Exceptions
  • 15. 15 The safety of Java  100% object oriented  Automatic garbage collection  Array bounds checking at runtime  Strict type checking  Structured exception handling
  • 16. 16 The ease of Visual Basic  First class support for properties  First class support for events  foreach loops
  • 17. 17 The power of C++  Enumerations  Operator overloading  Mathematical, Indexing, and Casting  Function pointers  Called “delegates”  Type safe  Structs
  • 18. 18 The power of C++  Option to pass parameters by reference or by value  Can disable type-safety, garbage collection, and bounds checking  Can directly manipulate memory with pointers
  • 19. 19 “foreach” loops  Iterates over arrays or any class that implements the IEnumerable interface  Does this feature look familiar?  JDK 5.0 imitates, though with different syntax Int32[] myArray = new Int32[]{10, 20, 30, 40};Int32[] myArray = new Int32[]{10, 20, 30, 40}; foreach(Int32 i in myArray){foreach(Int32 i in myArray){ Console.WriteLine(i);Console.WriteLine(i); }}
  • 20. 20 Automatic “boxing”  Automatically converts primitive values to objects as needed Stack s = new Stack();Stack s = new Stack(); s.push( 42 );s.push( 42 ); ...... int x = (int)s.pop();int x = (int)s.pop(); Stack s = new Stack();Stack s = new Stack(); s.push( new Integer( 42 ) );s.push( new Integer( 42 ) ); ...... int x = ((Integer)s.pop()).intValue();int x = ((Integer)s.pop()).intValue();
  • 21. 21 Inheritance and interfaces  C++ syntax  Simply use a colon and separate by commas  Can inherit from one base class  Can implement any number of interfaces class ArrayList : Collection, IEnumerableclass ArrayList : Collection, IEnumerable {{ …… }}
  • 22. 22 Fruit example: class Fruit & constructor using System; namespace FruitProject1 { public abstract class Fruit { protected string color; protected double size; protected Point center; /// <summary> /// Constructor with parameters /// </summary> /// <param name="color"></param> /// <param name="size"></param> /// <param name="center"></param> protected Fruit(string color,double size,Point center) { MyException ex = new MyException(); if (validColor(color)) this.color = color; else { ex.whatError = "Invalid color"; throw ex; } if (validSize(size)) this.size = size; else { ex.whatError = "Invalid size"; throw ex; } this.center = center; }
  • 23. 23 Fruit example: a few Fruit methods public void changeSize(double size) { MyException ex = new MyException(); if (validSize(size)) this.size = size; else { ex.whatError = "Invalid size"; throw ex; } } public double getSize() { return size; } public abstract bool validSize(double size); public abstract bool validColor(string color); public abstract void print(); /// <summary> /// For identifying object types /// </summary> /// <returns>Type of the object</returns> public override string ToString() //Is the keyword a good idea? { return "Fruit"; }
  • 24. 24 A couple of methods from class Apple public override bool validSize(double size) { if ((size>500) || (size<10)) return false; else return true; } public override void print() { // Automatically invoke ToString methods of object parts Console.WriteLine("Type:" + this + "- size:" + this.size + "- color:" + this.color + "- center" + this.center); }
  • 25. 25 Snippets from class Bowl using System; using System.Collections; namespace FruitProject1 { /// <summary> /// class Bowl models a bowl of fruit /// </summary> public class Bowl { private int capacity; private ArrayList fruitList = new ArrayList(); public Bowl(int capacity) { this.capacity = capacity; } public int getCapacity() { return capacity; } public int getNumberofFruits() { return fruitList.Count; } public bool addFruit(Fruit f) { if (fruitList.Count<capacity) fruitList.Add(f); else return false; return true; } //More methods… }
  • 27. 27 Basic Truths  J2EE  Java-centric and platform-neutral  J2EE is not a product you buy from Sun.  J2EE is a set of specifications which indicate how various J2EE functions must interoperate  If I don’t buy J2EE from Sun, how does Sun make money?  J2EE 1.4 released with features to completely support web services – JAX-RPC 1.1 API, J2EE Management 1.0 API, web service endpoints etc. (Hard to learn, hard to implement!)
  • 28. 28 Basic Truths  .NET  Windows-centric and language-neutral  .NET is a Microsoft product strategy that includes a range of products from development tools and servers to end-user applications.  Platform-neutral version of .NET is available Mono –Novell-sponsored, open source implementation of the .NET development environment ( http://www.go-mono.com )
  • 30. 30 .NET and Java: application platforms  .NET  The .NET Framework  Java  Java application servers  Products include:  IBM WebSphere Application Server  BEA WebLogic Application Server  Sun iPlanet Application Server  Oracle Application Server  Many others
  • 31. 31 .NET vs. Java: standard libraries  .NET Framework class library  Defined by Microsoft  Somewhat Windows-oriented  Organized into a hierarchy of namespaces  J2SE, J2EE  Defined by Sun and the Java Community Process  Not bound to any operating system  Defined as packages and interfaces
  • 33. 33 .NET Class Library  IO  GUI Programming  System Information  Collections  Components  Application Configuration  Connecting to Databases (ADO.NET)  Tracing and Logging  Manipulating Images/Graphics
  • 34. 34 Class Library  Interoperability with COM  Globalization and Internationalization  Network Programming with Sockets  Remoting  Serialization  XML  Security and Cryptography  Threading  Web Services
  • 35. Thanks… Questions? murat@lehigh.edu (Murat Ganiz) This presentation available at: www.cse.lehigh.edu/~glennb/oose/Csharp_dotNET.ppt

Editor's Notes

  1. The term .NET covers a lot of bases. The official marketing line from Microsoft can be seen on the slide here. Pretty vague don’t you think? I’d define it more succinctly as xxx. To you and me, as software developers, I would consider the above to be a good definition of the .NET framework. Not that it allows both standalone windows applications and distributed applications. You can guess which you’ll be building most, as nearly everything has some distributed component these days. Notice I also say Internet. That’s because .NET has embraced internet standards and protocols in a big way. This essentially means web services standards such as SOAP are used a lot. Although you can use your own protocols in your distributed applications using .NET. So, what does this platform offer us to develop with?
  2. Component oriented development has long been recognised as a sensible way of doing large scale development. So little commercial and indeed academic development is done from scratch, we all use other people’s code in some way or another, be it class libraries that come with dev envs, or purchased fro msome vendor, or that we wrote ourselves. Microsoft went a good deal of the way to realising true component oriented development with it’s COM technology…
  3. &amp;lt;number&amp;gt;