Title: CIS205
1CIS205
- Part 1 dbg --- Getting Acquainted with Visual
Studio.NET and C
23 Programming Platforms
Visual Studio.NET Java Open Source (LAMP)
Platform Windows All platforms Linux
Architecture .NET architecture Java Virtual Machine Apache Server
Databases supported Several DBMS Several DBMS MySQL
Programming languages supported C, C, VB, J, and some third party languages Java PHP
Advantages Visual Designer for GUIs ASP.NET for web pages Applets for client Servlets, JSPs for web pages Free
3The Visual Studio.NET IDE
- Visual Studio.NET is an Integrated Development
Environment (IDE). - It contains
- the Designer which makes it easy to create
Graphical User Interfaces (GUIs) - a context-sensitive text editor
- various language compilers (we will be using C)
- a runtime environment for testing/debugging our
code - Visual Studio.NET can be used with other
programming languages such as C and Visual
Basic.
4The .NET Framework
J
C
VB
C
Common Language Specification
ASP.NET Web Services and Web Forms
Windows Forms
Visual Studio.NET
ADO.NET Data and XML
Framework Class Library
Common Language Runtime
5Where Does C Fit?
GUIs Web Programming Fully OOP
MS Visual
MS
BASIC
Visual BASIC
BASIC.NET
Procedural programming
classes
1965
1991
2000
MS Visual
ANSI/ISO
BCPL B C
C C
C.NET
Procedural programming classes
1967 1970 1972
1985
1998 2000
Sun Microsystems
C combines the best features of C/C, Java, and
VB in a new visual, fully object-oriented,
event-driven programming language designed for
use with the .NET platform.
Java
1995 2000
MS Visual
C.NET
1997 2000
6Programming Windows with C
- A new language designed specifically for .NET
- Fully object-oriented
- Type safe language
- Built-in Visual Editor for GUI development
- Fundamental programming syntax resembles that of
C and Java
7Importance of C
- Microsoft wrote much of .NET system programming
in C and is currently writing next version of
Windows (Longhorn) in C. - In Special Report Security, PC Magazine, pg
78, 8/3/04 issue - In the course of putting together
Longhorn, says Nash, of Microsoft were
making sure that in the design phase, the
implementation phase, as we build the product ,
were looking for security and quality issues. - The company is also using design tools that
are far more conducive to building secure code.
It has discarded notoriously insecure languages
like C and C in favor of C and the Microsoft
.NET platform.
8C Features
- A considerable amount of pre-defined code resides
in the Framework Class Library (FCL). - C can be used to develop
- Console applications (procedural programming)
- Interactive Windows Forms applications (GUIs)
- Web Services (server programs)
- Interactive Web Forms (via ASP.NET)
- Like other .NET languages, code is compiled first
into MSIL (MS Intermediary Language) and then
into machine language.
9Objects
- Object Oriented Terminology
10Classes (templates)
- Classes are patterns for objects.
- You might think of a class as a cookie cutter and
a set of objects as cookies created with that
cutter (class). - An object is an instance of a class, and the
process of creating an object is called
instantiation.
Class
Objects
11Classes
- A class is code that defines the attributes and
operations of an object. - In this course, we may define some custom
classes. But mostly, we will use classes that
already exist in .NET libraries. - It is not necessary for a programmer who uses a
pre-existing class to know or understand its code
structure. This concept is called encapsulation.
12Objects (nouns)
- An object is a person, place or thing.
- Objects are instances of classes (template for
object). - All objects have attributes (variables) and
operations (methods). - What class would each of the pictured objects
belong to?
13Attributes (adjectives)
- Attributes (variables) are characteristics of an
object. - All vehicle objects have make, model, color,
number of doors, and fuel type. These attributes
(variables) are described in the class definition
(template for objects). - The pictured vehicle is a blue Smart forTwo with
2 doors that runs on regular gasoline these
characteristics represent values assigned to
attributes of this specific vehicle object.
14Operations (verbs)
- Operations (methods) are actions related to an
object. - The code associated with these operations
(methods) is part of the class definition. - You might purchase, sell, repaint, or crash a
vehicle. - These operations may affect the values of the
attributes of the vehicle object.