Application Servers G22.3033-011
Session 10 - Main Theme .Net/COM+ Component-Based Computing Environments
Dr. Jean-Claude Franchitti
New York University Computer Science Department
Courant Institute of Mathematical Sciences 1
Agenda
Web-Enabling Facilities (continued)
Java Web Start (JWS)
COM / DCOM Component Model and OLE
COM+ MTS Services: Transactions and Security
COM+ Message Queuing
.Net/COM+ Integrated Services
Enterprise Component Development with .Net/COM+
Designing .Net/COM+ Component-Based Architectures
Summary
Readings
Assignment #7 (continued) 2
1 Summary of Previous Session
J2EE Client Component Infrastructures (continued)
CORBA 3 OMA Services
CORBA 3 CCM
CORBA 3 Environments
Enterprise Component Development with CORBA 3
Designing CORBA 3 Component-Based Architectures
Summary
Readings
Assignment #7
3
Application Servers Architectures
Application Servers for Enhanced HTML (traditional)
a.k.a., Page-Based Application Servers
Mostly Used to Support Standalone Web Applications
New Generation Page-Based Script-Oriented App. Servers
First Generation Extensions (e.g., Microsoft IIS with COM+/ASP)
Servlet/JSP Environments
XSP Environment
Can now be used as front-end to enterprise applications
Hybrid development environments
Distributed Object Computing Platforms
Provide an infrastructure for distributed communications enabling
Still need to merge traditional web-oriented computing with object computing
Object Management Architectures
DOC Platform + APIs to reusable services and facilities 4 OMAs+Client/Server Component Models -> J2EE, CCM, DNA
2 CORBA 3 References
OpenCCM Documentation
http://openccm.objectweb.org/doc/index.html
Getting started with OpenCCM Tutorial
http://openccm.objectweb.org/doc/0.5/tutorial_Getting_Started_with_OpenCCM.ppt
OpenCCM Installation Guide
http://openccm.objectweb.org/doc/0.8/install_guide.html
OpenCCM 0.8 Download
http://openccm.objectweb.org/download/index.html
5
Part I
Microsoft Platform Architectures (includes slides covered in previous sessions)
Also See: “http://www.execpc.com/~gopalan/misc/compare.html” “http://www.javacoffeebreak.com/articles/rmi_corba/” “http://www.quoininc.com/articles.html”
6
3 Microsoft Active Platform (Logical Architecture)
7
Microsoft Active Platform (Features)
Logically centralized architecture
Physically de-centralized architecture
Scripting
Client-Side: Improved user interface and data validation
Server-Side: Business rules and data access
VBScript and JavaScript built-in support
PerlScript support via ActiveX scripting engine (e.g., ActiveState’s)
Ability to mix scripting languages
Active Server Components
Provide OS services to ASPs
Encapsulate business rules to ease programming
e.g., TextStream Component (FileSystem object) 8
4 Microsoft Active Platform (Physical Architecture)
9
Microsoft Component Object Model (Logical Architecture)
10
5 11
12
6 13
14
7 15
COM IDL (stockMarket.idl)
Example: [ uuid(7371a240-2e51-11d0-b4c1-444553540000), version(1.0) ] library SimpleStocks { importlib("stdole32.tlb"); [ uuid(BC4C0AB0-5A45-11d2-99C5-00A02414C655), dual ] interface IStockMarket : IDispatch { HRESULT get_price([in] BSTR p1, [out, retval] float * rtn); }
16
8 COM IDL (continued)
Example: [ uuid(BC4C0AB3-5A45-11d2-99C5-00A02414C655), ] coclass StockMarket { interface IStockMarket; }; };
17
18
9 19
DCOM Architecture Review
20
10 DCOM Object Activation/Method Invocation (top layer - basic programming architecture)
21
DCOM Object Activation/Method Invocation (middle layer - remoting architecture)
22
11 DCOM Object Activation/Method Invocation (bottom layer - wire protocol architecture)
23
24
12 COM+
See Session 4:
Sub-Topic 3 Presentation on Introduction to CORBA, DCOM, and RMI
See Session 5:
Sub-Topic 3 on Introduction to .Net/C#
Sub-Topic 4 on Building COM+ Applications
25
COM+ = DCOM/COM + MTS
26
13 DNA Web Architectures
FORM+ = Merger of Win32 GUI and Web APIs (~DHTML)
STORAGE+ = OLE DB
COM+ = COM + MTS 27
Distributed InterNet Applications Architecture (DNA)
28
14 Microsoft DNA Environment (summary)
See comparison of EJB and MTS models:
http://members.tripod.com/gsraj/misc/ejbmts/ejbmtscomp.html
Environment combines
COM+ (DCOM+MTS) Component Model
Win32/SCM and DCOM/COM+ Services
Visual Studio Development Environment
29
Microsoft IIS with COM+/ASP Features IDE:
Visual InterDev (ASP)
Management of site development process
Scripting
Alternative IDEs
Macromedia Drumbeat, Ultradev, Dreamweaver
NetObjects Fusion
Microsoft FrontPage 2000
Adobe GoLive
Server Platforms
Windows 2000/NT
Use ChiliSoft for other platforms (http://www.chilisoft.net/)
Platforms: Solaris, Linux, AIX, HP-UX, Windows
Immunity from current IIS attacks (e.g., code red worms on Win 2000)
Web Server: Apache, iPlanet
Chili!Beans support for Java (similar to Microsoft with COM+ and ASP for C++) 30
15 Microsoft IIS with COM+/ASP Features
See “Microsoft IIS, COM+, and ASP” in “Web Server Brains”
COM+ / ASP
Equivalent to J2EE EJB / JSP
Included in Microsoft Windows 2000 Advanced Server
COM+
Attributes (declare what runtime services are needed by the component)
Threads and database connection pools (access via Active Data Object API)
ASP Object Model sub-systems
HTTP request
COM+ transaction
External COM+ components
Other solution components:
Visual Studio 6.0
Internet Security and Acceleration Server (ISA)
static content caching, fault tolerance, load balancing, request handling 31
Microsoft .NET Platform Smart Devices + Windows XP + Web Services
http://www.microsoft.com/net
First set of Microsoft Web Services
http://www.microsoft.com/net/hailstorm.asp
32
16 Part II
Win32 and COM+ Services (includes slides covered in previous session and new ones)
“http://members.tripod.com/gsraj/misc/ejbmts/ejbmtscomp.html and related archives”
and Session 10 Sub-Topic 1 Presentation on “A COM+ Application Scenario”
33
DNA OMA Services
Activation Services
DCOM Activation Framework
Naming and Directory Service
DCOM Class and Object Naming (i.e., CLSIDs, ProgIDs, and Monikers)
Trading Service
Microsoft Active Directory
Transaction Service
COM+ MTS
Messaging Service
COM+ MSMQ
34
17 Win32 Services
Win32 executable that satisfy several properties
Lifetime is controlled by the Service Control Mgr (SCM)
Service is registered with SCM, and understands and obeys SCM commands
Service has its own login session or shares one with another service
Service runs as a user or local system and abides to applicable security
Service implements a set of service-specific functions:
Starting up, message handler, communication back to SCM
35
COM+ Services
COM+ Catalog (v.s. Windows Registry)
COM+ Load Balancing
COM+ In-Memory Database (IMDB)
COM+ Object Pooling
COM+ Queued Components
COM+ Events
C++ Compiler Changes
36
18 DCOM Class and Object Naming (file moniker file: bind)
37
DCOM Class and Object Naming (url moniker http:, ftp:, gopher: bind)
38
19 DCOM Class and Object Naming (class moniker clsid: bind)
Display name for class monikers: display-name = "CLSID:" string-clsid-no-curly-braces *[";" clsid-options] ":" clsid-options = clsid-param "=" value clsid-param = none currently defined
C++ example (tell moniker to use an object that can read a document instead of the document itself): ProgIDFromCLSID( &clsid, "xyz.activator.1") CreateClassMoniker( clsid, &pmkClass ) MkParseDisplayName( pcb, "\\northamerica\central\employee.doc", &dwEaten, pmkFile ) pmkFile->BindToObject( pcb, pmkClass, IID_IDispatch, &pDisp ) 39
COM+ Catalog v.s. Windows Registry
Stores COM+ application attributes, class attributes, and computer-level attributes
Guarantees consistency among attributes
Provide common operations on top of attributes
Two different stores
COM+ registration database
Microsoft Windows Registry (HKEY_CLASSES_ROOT)
COM components that do not require new COM+ services
Type library
Interface proxy/stub registration
Unified logical view via COM+ Admin Library 40
20 Microsoft Active Directory
Maintains user, security, and network resource information used on a Windows 2000 network DCOM components can store their activation and connection information in the ADS COM objects can be exposed as APIs to ADS
41
Trading Service - Active Directory http://www.microsoft.com/windows2000/server/evaluation/features/dirlist.asp
42
21 COM+ Load Balancing
43
COM+ IMDB
44
22 MSMQ Messaging
Upon queued component instantiation
Local recorder proxy object is created
As the client makes method calls
Local recorder object serializes the calls into MSMQ messages
Client commits the object by releasing all references to it
Message is passed to the server via MSQM
Special service running on the server de-queues messages and instantiate the component using a player proxy
Upon failure
A message is placed back on the queue
Getting back to the client
No response needed
Response queues (asynchronous reporting) 45 Pass by value interface references
COM+ Queued Components
46
23 Using COM+ Queued Components Svc.
Example:
IOrder* pOrder = 0; CoCreateInstance( CLSID_Order, ... IID_IOrder, (void**) &pOrder );
pOrder->put_Customer( 2000 ); pOrder->put_Quantity( 2 ); CComBSTR bstrSKU( "3535-2334" ); pOrder->put_SKU( bstrSKU );
long lOrderNumber; pOrder->Submit( &lOrderNumber ); pOrder->Release(); 47
COM Event Handling Mechanisms
Events/Callbacks via client interface
Client implements an interface defined by the component
Uses Advise/Unadvise methods (see example in later slide)
Events/notifications are handled via calls through the client interface
Connectable Objects via COM Events model
Uses standard COM IConnect-ionPoint interfaces
Includes runtime recovery and minimal multi-casting capabilities
Objects play the role of publishers/subscribers
No support for persistent connection
Overall complex Event model to use
COM+ Events model
Introduces an event class object to decouple publisher and subscriber 48
24 COM+ Events
49
Using COM+ Events
COM Event Model: // Our event interface interface IMyEvents : IUnknown { HRESULT SomethingHappened( BSTR bstrWhat ); } // An interface on our component interface ISomeInterface : IUnknown { ... HRESULT Advise( IMyEvents* pIEvents ); HRESULT Unadvise(); }
COM+ Event Model: interface IEventClass : public IDispatch { HRESULT put_EventClassID( BSTR bstrEventClassID ); HRESULT put_EventClassName( BSTR bstrEventClassName ); HRESULT put_FiringInterfaceID( BSTR bstrFiringInterfaceID ); ... }; 50
25 C++ Compiler Changes
Sample Attributes:
in/out direction of parameter in a method
threading model
component housing (i.e., DLL or EXE) 51
Creating an MTS Component
Example:
try {
// create the MTS component bank.IChecking server= (bank.IChecking) new bank.Checking ();
// invoke business methods on the component server.createAccount (1234, "Athul", 1000671.54d); } catch (Exception ex) { ex.printStackTrace (); }
52
26 .NET Framework
Common Language Runtime (CLR)
Accessible to any compiler that produced Microsoft Intermediate Language (IL) code
Runtime Classes
Visual Studio.Net (VS.Net)
Includes VB.Net, VC.Net (C#), and Visual C++.Net
53
.NET, Win32, COM, and COM+
.Net applications can call functions that reside in Win32 DLLs via the DllImport attribute of System.Runtime.InteropServices’ platform invocation (PInvoke) services
.Net applications can call traditional COM components using Runtime Callable Wrappers (RCWs) which uses interop assemblies (i.e., .Net components) created via COM Interop using the TLBIMP utility
COM+ services (transactions, object pooling, JIT activation) can be used from .Net (via System.EnterpriseServices namespace)
.Net runtime uses COM+ to support some of its services (e.g., transactions for managed classes) 54
27 .Net Remoting (http://www.dotnetremoting.cc/)
Native .Net Remote Object Invocation
Allows Object Invocation and Communications Across Processes and Machines
Wire Protocol and Format Independent
Extensible via Custom Formatters (SOAP, Binary, etc.), Channels (HTTP, TCP, etc.), and Sink Chain (i.e., Channels + Formatters) Steps
Flexible as Configuration can be Changed after Deployment with Little or no Code Changes
Flexible (IIS not required on server) but more Complex than Web
Services 55
.Net Remoting Vs. DCOM
Not as Transparent as DCOM
Has no COM Interop Involved
Offers More Deployment Options
Not Tied to a Specific Wire Protocol or Format
Firewall Friendly
Allows you to Specify which Objects are Remoted
56
28 .Net CLR and COM+
CLR Introduces a Newer and Easier Programming Model for COM+
The COM+ Services are still Available only at the OS/Unmanaged World
Transitions Between Managed/Unmanaged Layers are Taken Care of by “System.EnterpriseServices” Namespace
System.EnterpriseServices.ContextUtil class provides access to contexts (as did CoGetObjectContext)
Services are Made Available to Components Using Attributes 57
ContextUtil Class
Useful Static Members
ActivityId
IsSecurityEnabled
TransactionId
DesactivateOnReturn
MyTransactionVote
Rich Set of Member Functions
SetComplete
SetAbort
EnableCommit
DisableCommit
IsCallerInRole
GetNamedProperty 58
29 .Net and ServicedComponent
COM+ Class Derives from “ServicedComponent” [ComVisible(true)] [ObjectPooling(MinPoolSize=2, MaxPoolSize=5)] [Guid(“57F01F20-9C0C-4e63-9588-720D5D537E66)] [Transaction(TransactionOption.Required)] public class SVCCompClass : ServicedComponent
In COM+ 1.0, the List of Services Are not Changed
In COM+ 1.5 (Microsoft Windows XP Professional and .Net server), Newer Services are Available to Leverage CLR Features
59
Component Layers in .Net Applications/Services (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/distapp.asp)
60
30 Security Policies in .Net Applications/Services
61
Operational Mgmt Policies in .Net Applications/Services
62
31 Communication Policies in .Net Applications/Services
63
.Net Applications Support Technologies/Services (continued)
Security, Operational Management, Communication provided by Microsoft Windows OS Services
Active Directory Service
Message Queuing
Windows Management Instrumentation (WMI)
etc.
64
32 .Net Applications Support Technologies/Services
65
Part III
COM+ Application Scenario
See Session 4 Sub-Topic 1 on “Distributed Communications Enabling”
66
33 Part IV
Enterprise Component Development with .Net/COM+ (See Intro to C# at: http://www.ecma- international.org/activities/Languages/Introduction%20to%20Csharp.ppt, overview of .Net at http://www.enterprise-component.com/docs/WebServWs.ppt and http://www.enterprise-component.com/docs/WebServWs.ppt)
67
Application Platforms Today
Browser Web Services Local Other Apps Apps Apps Apps
GUI Transaction Web Data Remote More Services Services Scripting Access Access Standard Library
Runtime Environment
Operating System 68
34 Component development with COM and CORBA
Client Server component component
IDL Stub
Component “Bus” 69
IDL spec module Reservation {interface Flight_booking { Price ticket_price (in Date day, in Flight number) raises (invalid_date, invalid_number); exception invalid_date {Date when; }; readonly attribute string name; ...} };
70
35 The role of IDL
• Provide language-neutral interface description of a module’s operations • As a result, enable clients and suppliers written in different implementation languages
71
The trouble with IDL
• Programmers must write IDL interface in addition to actual software • If from an O-O language, IDL duplicates information present in the code, e.g. C++ header file • Perils of duplication • IDL compiler goes the wrong way! • However: some tools ease the process. 72
36 Pre-.NET approaches: summary
• Object technology is best known basis • Information hiding is key • O-O sufficient by itself: need for autonomous components • Current approaches too heavy: extra work to turn module (e.g. class) into component • IDL is a killer
73
.NET Framework Design Goals
• Dramatically simplifies development and deployment • Unifies programming models • Provides robust and secure execution environment • Supports multiple programming languages
74
37 Framework, Languages, And Tools
VB C++ C# JScript J#
Common Language Specification
ASP.NET Visual Studio.NET Windows Web Forms Web Services Forms Mobile Internet Toolkit
ADO.NET and XML
Base Class Library
Common Language Runtime
Operating System 75
Framework, Languages, And Tools
VB C++ C# JScript J#
Common Language Specification
ASP.NET Visual Studio.NET Windows Web Forms Web Services Forms Mobile Internet Toolkit
ADO.NET and XML
Base Class Library
Common Language Runtime
Operating System 76
38 The .NET Evolution
Application
Code and data structures
Before COM, applications were completely separate entities with little or no integration
77
The .NET Evolution
COM provides a way for components to integrate; However, each component must provide the “plumbing” and objects cannot
directly interact 78
39 The .NET Evolution
With the .NET Framework common language runtime, components are built on a common substrate; No “plumbing” is needed and objects can directly interact 79
Compilation And Execution
Compilation Source Language Code (IL) Assembly Code Compiler Metadata
Native JIT Code Compiler At installation or the first time each Execution method is called
80
40 Simplify Development
• Completely eliminates COM plumbing •No more… – Registration =>self described apps –GUIDs =>hierarchical namespaces – .IDL files =>unified object model –HRESULTs =>structured exceptions – IUnknown =>common root object – AddRef/Release =>garbage collector – CoCreateInstance =>”new” operator
81
Simplify Development
• Common Type System – Common instance and type definition • Enables clean OO programming – Classes and interfaces – Constructors, properties, methods, events – Cross language inheritance • Built-in interoperability – With COM – With native (Win32® style) DLLs 82
41 Robust Environment
• Automatic lifetime management – All objects are garbage collected • Exception handling – Error handling first class and mandatory • Type-safety – No buffer overruns, No unsafe casts, Uninitialized variables
83
Secure Environment
• Security designed-in • Code access security enforcement – Security based on the identity of code – Administratively configurable via policy • ASP.NET integrated authentication of user – Windows identity, Passport®, forms-based, … • Cryptography library with XML DSIG support – Digital signature for XML (www.w3.org/signature)
84
42 Simplify Deployment And Management
• Zero-impact install – Applications and components can be shared or private • Side-by-side execution – Multiple versions of the same component can co- exist on a system • Assemblies – Contain dependency information
85
Framework, Languages, And Tools
VB C++ C# JScript J#
Common Language Specification
ASP.NET Visual Studio.NET Windows Web Forms Web Services Forms Mobile Internet Toolkit
ADO.NET and XML
Base Class Library
Common Language Runtime
Operating System 86
43 Unify Programming Models
Consistent API availability regardless of language and programming model .NET Framework
RAD, Subclassing, Stateless, Composition, Power, Code embedded Delegation Expressiveness in HTML pages VB Forms MFC/ATL ASP
Windows API 87
How Much Simpler?
Windows API HWND hwndMain = CreateWindowEx( 0, "MainWClass", "Main Window", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, (HWND)NULL, (HMENU)NULL, hInstance, NULL); ShowWindow(hwndMain, SW_SHOWDEFAULT); UpdateWindow(hwndMain);
.NET Framework
Dim form As New Form() form.Text = "Main Window" form.Show() 88
44 Factored And Extensible
• The Framework is not a “black box” • Any .NET class is available for you to extend through inheritance – Gives developers much more head room • Plug and Play components and subsystems
89
The .NET Framework Library
ASP.NET Web Forms Web Services Windows Mobile Internet Toolkit Forms
ADO.NET and XML
Base Class Library
90
45 The .NET Framework Library
System.Web System.Windows.Forms Services UI Design ComponentModel Description HtmlControls Discovery WebControls Protocols System.Drawing Caching Security Drawing2D Printing Configuration SessionState Imaging Text
System.Data System.Xml OleDb SqlClient XSLT Serialization Common SQLTypes XPath
System Collections IO Security Runtime Configuration Net ServiceProcess InteropServices Diagnostics Reflection Text Remoting Globalization Resources Threading Serialization 91
Base Framework
System Collections Security Configuration ServiceProcess Diagnostics Text Globalization Threading IO Runtime Net InteropServices Reflection Remoting
Resources Serialization 92
46 Data And XML
System.Data OleDb SQLClient Common SQLTypes
System.Xml XSLT Serialization XPath
93
System.Web Services UI Description HtmlControls Discovery WebControls Protocols Caching Security Configuration SessionState
94
47 Windows® Forms
System.Windows.Forms Design ComponentModel
System.Drawing Drawing2D Printing Imaging Text
95
Framework, Languages, And Tools
VB C++ C# JScript J#
Common Language Specification
ASP.NET Visual Studio.NET Windows Web Forms Web Services Forms Mobile Internet Toolkit
ADO.NET and XML
Base Class Library
Common Language Runtime
Operating System 96
48 Languages
• The .NET Platform is language neutral – All .NET languages are first class players – You can leverage your existing skills • Common language specification – Set of features guaranteed to be in all languages • We are providing – Visual Basic®, C++, C#, J#, JScript® • Third-parties are building – APL, COBOL, Delphi, Pascal, Eiffel, Haskell, ML, Oberon, Perl, Python, Scheme, Smalltalk…
97
Standardization
• A subset of the .NET Framework and C# submitted to ECMA – Adopted as International standards in Dec. 2001 – In the ISO fast-track process now – Co-sponsored with Intel, Hewlett-Packard • Common language infrastructure – Based on common language runtime and base framework – Layered into increasing levels of functionality 98
49 Summary
• The .NET Framework – Dramatically simplifies development and deployment – Unifies programming models – Provides robust and secure execution environment – Supports multiple programming languages
99
Execution scheme under .NET
C# VB C++ Eiffel .NET languages
Language compilers
IL code (plus metadata) Loader JIT + verifier Unjitted routine call Managed code
Execution 100
50 The basic .NET component unit
Result of compilation is an assembly Assembly is a set of classes Unit of: • Delivery and deployment • Naming (through namespaces) • Security (level for granting permissions) • Versioning & side-by-side execution
Self-documenting through “manifest”
101
The Single Product Principle
• There is one product: SOFTWARE
e.g., Eiffel: use single, seamless notation throughout the development cycle Rely on tools to produce documentation Maintain just one product!
102
51 Single Product Principle in .NET
• It’s all in the metadata!
Definition: • Metadata is information about a module’s external properties, not necessarily needed for executing the module, but retained after compilation along with the binary code
103
Examining an assembly with ildasm
104
52 How is the metadata stored?
• Stuffed into PE (Portable Executable) format • To Windows, result of compiling an assembly looks like ordinary binary (*.dll or *.exe), but contains all kinds of supplementary information • Will execute on .NET only
105
The Portable Executable (PE) format
106
53 Execution model: the role of metadata
C# VB C++ Eiffel .NET languages
Language compilers
IL code (plus metadata) Loader JIT + verifier Unjitted routine call Managed code
Execution 107
Metadata contents
• Manifest: assembly description – Name, version, culture – Security properties: Needed permissions – Public key if present – Dependencies on other assemblies • List of classes • For each class: – Features: methods, fields, properties, events – Signatures (argument and result types) of each – Interfaces it implements • Custom attributes (see next) 108
54 Working with metadata
Letting a program access metadata: • Use System.Reflection Examining metadata interactively: • Use ILDasm Can convert metadata to: • XML • COM type libraries (regasm) To produce metadata: • Use System.Reflection.Emit 109
.NET component model
• Single product principle: full reflectivity; assemblies are self-documenting • (Groups of) classes directly yield components • No extra plumbing •No IDL • Full application of Object-Oriented principles • Multi-language interoperability
110
55 Part V
Designing .Net/COM+ Component-Based Architectures (See: Architecture Driven Development at http://www.wildetechnologies.com/video/WildeVSLaunch2003.ppt, business process modeling at http://www.enterprise-component.com/docs/WebServWs.ppt Web Services Software Development Lifecycle at http://www.enterprise-component.com/docs/WebServWs.ppt, and .Net vs. J2EE in http://www.disi.unige.it/person/ReggioG/ISII01/DotNet.ppt)
111
Component-based software development
• Creating re-usable language-neutral software components that conform to a binary component standard • Removes many of the problems faced in trying to develop re-usable pieces of software • Many standards exist – COM, CORBA, Java Beans, .Net • 2 MS standards – COM (Component Object Model) and .NET
112
56 Problems with traditional development
Lack of binary compatibility • XYZ Corp markets a C++ library containing a class MyClass • MyClass is extremely useful so ABC Software Company creates a dozen of applications that use MyClass • XYZ Corp decides to fix some bugs in MyClass. In doing so, they add another private class member. • The new class is not binary- compatible with old one – ABC Software will have to recompile all its applications
113
Problems with traditional development
Language compatibility • Without COM, software developed in one language cannot be easily used from another • C/C++ and Visual Basic example: • VB can use C-functions but only in a limited manner • VB cannot use C++ classes • C/C++ cannot use functions/procedures/classes developed in VB • Result: headache for library vendors and users alike
114
57 Problems with traditional development
Location dependence • Without COM, the code using a library is locked into having the library at a particular location, e.g. in a DLL sitting in a system directory
115
COM to the rescue
• Complete binary compatibility – new versions of a library can simply replace the old version. It’s not necessary to recompile the code that uses that library • Language independence:
VB / C / C++ / FORTRAN / JavaScript / ….
C++ VB C Fortran
COM components 116
58 Conventional solution
• “Portable” base class library developed in C++ using only ANSI C++ features
• COM wrappers for the classes to make them accessible from other languages
117
User desktop FORTRAN Server-side application in VB program script - JScript
IArray1D IArray2D IWave1D IWave2D
COM wrappers (C++, tied to Windows)
CArray1D CArray2D CWave1D CWave2D
CInternal1 CInternal2
Base library (ANSI C++ only, portable)118
59 Pros and Cons
• Library can be used from • Library has to be developed in a a variety of languages single language – C++/C • Binary compatibility is • Difficult to develop portable maintained across versions code • Portability not complete due to • Base class library is differences in compilers portable to all platforms • Source code has to be supporting C++ distributed • Base library cannot access rich functionality provided by the platform in runs on
119
The .Net solution
What is .Net?
• Execution environment with managed memory • Rich class library - .Net Framework • Common Language Specification / Runtime that allows for seamless interoperability between different programming languages
120
60 How it works
VB Source C# Source C++ Source Fortran File File File Source File
VB.net C# C++ .Net Fortran .Net compiler compiler compiler compiler
Intermediate OS / CPU independent Language
Just-In-Time Compiler
Executable code in memory 121
.Net solution
Rich functionality Web Page provided by the .Net Framework: JScript Application •Essential classes: VB collections, string manipulation, math etc. •Security VB •User interface C# Fortran •Networking Cobol •Graphics C++ •Database access Others •Etc. Base class library
122
61 Pros and Cons
• Seamless interoperability between • Possible portability problems: different languages • A lot less platforms will be • Binary compatibility across all supported CPUs and operating systems • Cost of .Net implementations • Effortless portability to all for non-Windows platforms is platforms supporting .Net unknown • Full interoperability with COM • Time of availability of non- • Rich platform functionality can be Windows implementations is used in the base library unknown • Possibly reduced development time • Exactly which platforms will be and increased robustness due to supported is unknown services provided by .Net e.g. • Considerable performance memory management penalty
123
Towards Web Services (http://msdn.microsoft.com/webservices/building/wse/default.aspx)
Web Services Enhancements (WSE 2.0)
http://msdn.microsoft.com/webservices/building/wse/default.aspx
Add-on to Microsoft Visual Studio .Net and the Microsoft .Net Framework
policy framework, enhanced security model, message-based programming model, and support for multiple hosting environments
Plateaus of adoption
Integration as an afterthought
Web services façades
Managed Web services and, finally
Paradigm shift
Industry currently focuses on the second plateau 124
62 Integration as an Afterthought
The current enterprise conjecture consists of a collection of self- contained custom or packaged applications
Packaged applications may expose functions via an API allowing some level of point-to-point integration
125
Web Services Façades
Adopting Web services first requires "wrapping" existing applications with a Web services façade
The resulting architecture resembles early EAI implementations, but provides the added benefit of standard protocols
126
63 Managed Web Services
In most cases, package applications are not designed to enable the replacement of underlying services
As a result, the resulting Web architecture remains a hybrid in which some applications leverage common infrastructure services while others access their own internal services 127
Paradigm Shift
In a true service-oriented architecture, all business services use a common set of business-neutral services for logging, notification and security
128
64 Challenges
Evolving standards
Immature tools
Semantic mapping
Network reliability
Performance
Application ownership
Learning curves
129
“Agile” Methodologies
See Session 8 Sub-Topic 2 Presentation:
Sample Project Development Methodology
http://www.thoughtworks.com/library/agileEAIMethods.pdf
http://www.thoughtworks.com/library/newMethodology.pdf
130
65 Part VI
Conclusion
131
Summary
JWS provides the convenience of desktop applications for downloaded applications with Zero Client Administration
Microsoft’s DOC platforms implement the OMA architecture
Provide platform specific support for services
Support an integrated set of horizontal and vertical facilities
Capabilities are bundled with the Operating System
COM+ introduces a new naming service technology
DNA provide transactions and messaging services
DNA support web-enabling which is being extended with trading capabilities via Web Services
.Net/COM+ simplifies application development
Server Components v.s. Client Components
Enterprise apps & Web Services v.s. workgroup apps 132
66 Goals
Show by example that .Net/COM+ makes it:
As easy to develop Server Components as it is to develop Client Components
As easy to deliver enterprise applications and Web Services as it is to deliver workgroup apps!
133
Readings
Readings
Microsoft .NET Distributed Applications: Building Application Servers
Chapters on .Net Remoting and COM+ Services
Handouts posted on the course web site
Explore .Net/COM+ Environment
Read related white papers/documentation on the .Net/COM+ environments
134
67 Project Frameworks
Project Frameworks Setup (ongoing)
Apache Web Server (version 1.3.28/2.0.47, www.apache.org)
Perl (version 5.8.0, www.perl.com)
Microsoft IIS with COM+/.Net and ASP
Sun One Active Server Pages 4.0 http://wwws.sun.com/software/chilisoft/index.html
Apache Tomcat
Macromedia JRun4
Apache Cocoon 2/XSP
Visibroker, Orbacus
RMI-IIOP
WebLogic 8.1, WebSphere 5.0, JBoss
Inprise AppServer, Sun ONE, Sybase EAServer, Oracle 9i, IONA iPortal, Xoology Concerto, Aligo M-1, Advanced Network Systems WebIx
GOAL Group OpenCCM, ExoLab.org OpenCCM, iCMG K2-CCM (C++), MICO/E (Eiffel ORB), JavaCCM, TAO Group, IONA iPortal (no CCM), Borland AppServer (no CCM), Sourceforge MI-3 (“Mission Impossible 3”) and CIF projects 135 Visual Studio .Net 2003 / .Net Framework SDK
Assignment
Explore the references to .Net/DNA Application Server technology
Homework #6 due date is 11/12/03
Homework #7: due date is 11/26/01
136
68 Next Session: XML-Based Capabilities in Component-Based Environments
.Net Environment (continued)
EAI Environments
B2Bi Environments
BPM Environments
Channel Independence and Pervasive Devices
137
69