Академический Документы
Профессиональный Документы
Культура Документы
Microsoft Assemblies
Requirements
Analysis
Implementation
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Understand
Microsofts component (assembly) architecture
required rudiments of C#
Be able to
create assemblies using C#
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
.NET
Goals and
Solutions
Avoid registry
o Necessity to register components with host computer
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
XML
IO
Security
uses
....
uses
....
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Boolean
DateTime
Double
GUID
Sbyte
Single
Methods of System.Object
Int32 GetHashCode()
o Generates an integer corresponding to
the value of the object
o Used by sorting algorithms in
System.Collections
Type GetType()
o for the Reflection API
String ToString()
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Collections
Drawing
Security
ComponentModel
IO
Text
o to implement the
Net
o to interface with
etc.
common
time behavior of
network
components
o ASII, Unicode
Threading
Web
WinForms
XML
protocols
Data
o To deal with
Reflection
Runtime
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Base class
library
Compiler &
metadata
generator
IL and
metadata
Class
loader
.dll or .exe
IL compiler
native code
Key:
Process
File
execute
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Manifest
Identity
A File
o name
o version
A File
A File
Names of files
Encrypted hash of files
to ensure integrity
Specification of types
defined
Names of referenced
assemblies
Specification of required
security permissions
Microsoft
Intermediate
Language
(IL)
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
C# Goals 1 of 2
Cross-platform deployment
o generates character stream interpreted by .Net runtime.
e
k
o as with Java Virtual Machine
i
l
Un
Java
o take advantage of the Windows API to run as a fullfeatured application on Windows 2000
Unlike
Java
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
C# Goals : 2 of 2
Features
Unlike
Java
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
HelloWorld Output
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Selected C# Features
Unlike
Java
Introduces Interfaces
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Using
Input file
output
Component (output) name
target
Create a library component: Dont seek Main()
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
helloFile.cs
csc /t:library /out:hello.dll helloFile.cs
hello.dll
hello.dll
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
helloClient.cs
hello.dll
helloApp.exe
now execute helloApp.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
HelloClass
AuRevoirClass
HelloAuRevoirComponentSource.cs
csc /t:library /out:helloAuRevoir.dll
HelloAuRevoirComponentSource.cs
helloAuRevoir.dll
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
interpreted,
JITted (Just-in-time)
native
legacy code (prior to .NET)
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Manifest of
Component
helloAuRevoir.dll
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
--
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Major version
Minor version
Revision
Build number
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Versioning
(The process of evolving a component over time in a compatible manner.)
A new version is
Attributes in .NET
Metadata: about
o
o
o
Types of attributes:
o
o
variables
classes
functions
Built-in
User-defined
Available at runtime
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Using NameSpaces
Implement applications 1and 2. Exploit common components.
Application 1: List available flights in following form
<Animated airline logo goes here>
<Material introducing available flights here >
From <city> to <city> departing at <time> and arriving at <time>.
<Animated logo of the Intergalactic Reservation Service goes here>
Availability namespace
Logo
AvailabilityAnnouncement
Itinerary namespace
Logo
ItineraryAnnouncement
Namespaces Across
Multiple Components
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
use
private
Hashed version
Encoded version
key
hash
AssemblyInfo.cs
Assembly source
Manifest
assembly
Public Key
Encryption
Verification process
OK / not OK
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.
Summar
y