How I may help
LinkedIn Profile Email me!
Call me using Skype client on your machine

Reload this page Enterprise Application Development

This page contrasts enterprise level applications architectures offered by Microsoft and Java Enterprise Edition.
See my companion page on Asynchrounous Messaginganother page on this site
Let me know what you find helpful or missing.

A Detailed Comparison of CORBA, DCOM and Java/RMI by Gopalan Suresh Raj takes an in-depth look at these technologies and provides specific code examples for each.

 

Topics this page:
on this page The Microsoft Way: ADO, COM, DAO, DCOM, MDAC, ODBC, OLEDB, RDO

  • Database connection 
  • COM/ActiveX 
  • Message Queues 
  • RMI
  • CORBA
  • COM+ LR Counters
  • Your comments???

  • Site Map List all pages on this site 
    About this site About this site 
    Go to first topic Go to Bottom of this page


    Set screen The Microsoft Way:

      Over time, Microsoft has promulgated several architectural designs:

      1. Desktop centric processing with Windows 9X.
      2. Host centric Client Server processing by components COM, RPC, ADO, OLE-DB, and ODBC on Windows NT 4.0 machines.
      3. Distributed Server processing with RPC, COBRA, IIOP on Windows 2000 machines talking directly to other specific machines.
      4. Dynamically configured systems where transactions are event-driven, message-based, and intermediated. This is SOA (Service Oriented Architecture) achieved through Microsoft's Dynamic Systems Initiative (DSI) on Windows Vista machines.

    Go to Top of this page.
    Previous topic this page
    Next topic this page

      To call COM from .NET:

      1. Register COM dll with regsvr32
      2. Add reference to dll in project so Visual Studio can generate a proxy.
      3. Invoke componenents by creating a runtime callable wraper (ie instance of proxy class).

      To expose .NET components to COM (unmanaged code):

      1. Generate strong name with sn.exe
      2. Add reference to strong name in .config file AssemblyKeyFile.
      3. Choose "Register for COM Interop" or manually register and generate type library using RegAsm.exe.
      4. Expose class members through an interface.

      Universal Data Access (UDA) was Microsoft's ambitious vision that "Any client should be able to use data regardless of where and how it is stored. Conversely, any computer that stores data should be capable of sharing that data with any client." The technical term for this is "heterogeneous data access."

      To obtain information from a database on a server, programmers need to first connect to a data source on a server, then specify parameters to issue commands for retrieving a recordset containing fields .

      The (Microsoft® Data Access Components) MDAC SDK provides the infrastructure to implement Microsoft's COM (Component Object Model) architecture of components. ODBC 1.5x first appeared December 1997. MDAC 2.0 was released in July '98 with the introduction of Visual Studio 6. MDAC 3.5 arrived April, 1993.

      Microsoft (Open DataBase Connectivity) ODBC Driver Manager library (odbc32.dll) manages communication between applications and ODBC drivers. ODBC drivers are available for every major DBMS in use today, including non-Microsoft database products such as Oracle and Sybase as well as for Microsoft's SQL Server, FoxPro®, and Access.

      Data Access Objects (DAO) provide native COM interfaces (object models) to Microsoft's JET (Joint Engine Technology) database engine shipped with Access and Visual Basic. Jet is really a series of .DLL files that manage data access. JET is based on the Index Sequential Access Method (ISAM) which works with simple flat structured indexes.

        VB6 File System Objects (FSO) are used to manipulate files and directories. The VB6 CreateObject function allows the specification of an optional machine name to create objects on remote systems.

      Perl 5 programmers use the Database Independent Interface (DBI) module.

      Remote Data Objects (RDO) provides a COM interface overlay to ODBC API since the Enterprise Edition of Visual Basic 5.0. DAO and RDO were phased out by Microsoft.

      DAO allows databases to be encrpyted using DES. Using DAO and Jet you can create groups of users that have various priviliges. You can set passwords as well. I have developed financial apps using DAO and Jet that have multi-tiered security profiles. [Thus,] some users could do things that others could not. These capabilities are built-in to DAO/Jet.

      ADO is a generalized approach to many data stores.

     


     

    Set screen OLE-DB



     
    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Much Ado About Databases:

      ActiveX Data Objects (ADO) provides a set of high-level data access components which make use of OLE DB. ADO is called a "dual-interface" because it can be used in either Web or Windows-based applications. The Microsoft® ODBC Provider allows ADO to bonnect to any ODBC data source. The provider is free-threaded and unicode enabled. The upcoming OLE DB for OLAP 1.0 spec enables the representation, expression, transportation, and efficient navigation of multidimensional (rather than the currently tabular) datasets (by the Knosys Dimensional Browser).

      This infrastructure gives programmers several ways to interact with databases:

      1. Stand-alone applications
        Compile .DLL executable files from source code written by programmers in the Microsoft Visual Basic®, Microsoft Visual C++®, or Microsoft VisualJ++™ programming language. These files must reside on every client machine. This method uses Microsoft's OLE DB data provider (more on this later).
      2. Using Internet Browsers ("Thin Clients")
        Embed within client-invoked HTML files Microsoft-defined VBScript programming language statements (instead of Netscape's JavaScript statements).
        • VBScript statements are placed between <% and %> markers.
        • ActiveX objects are placed between <OBJECT> and </OBJECT> markers. ActiveX controls run on Internet Explorer 3.0, as well as Netscape Navigator 3 through a Netscape plug-in.
        • VBScript does not allow functionality such as file input/output (I/O) or graphics, which might compromise the security of an end-user's system.
        • To use ADO with Microsoft Visual Basic® or Microsoft Office, you also need to establish a reference to the ADO type library. From the Project menu, select References, check the box for "Microsoft ActiveX Data Objects 1.5 Library," and then click OK. ADO objects, methods, and properties will then be accessible through the VBA Object Browser and the IDE Editor.
          • In Visual Basic, adovbs.inc include file reference the ADO API msado15.dll to control ProgID ADOR on the client and progID ADODB on the server. In VB6, ADO Data Controls is in MSADODC.OCX.
          • Custom Data Control for Visual Basic 5.0 from ISG gives data-aware controls access to ADO and OLEDB data sources in the same way a standard Microsoft data control gives access to ODBC data sources.

        There are two types of connections available:

        1. The "blinking" approach.
          Active Server Pages (ASP's) serviced by IIS running on a server. Because any data manipulation, scrolling, updates, and so on take place on the server, performance will be slower because more round trips are required between the client and the server. entire data frame on the screen has to be repainted.
        2. The "no blink" approach.
          The Microsoft OLE DB RDS (Remote Data Service) running on the server provides Synchronization Services which allow an entire recordset to be manipulated locally by a client program, then returned to the server. Since data is manipulated locally, there is no blinking associated with screen refreshes. Cursors keep a client's data synchronized. In MDAC 2.0, offline synchronization will allow recordsets created while connected to the data source to be taken offline, updated, and synchronized upon reconnect. This capability facilitates the creation of applications for mobile users and remote offices.

     
    • Properties allow the developer to view or set the attributes or characteristics of an object. Properties are often said to describe the object.
    • Methods are used by a developer to cause an action to occur on, or with the object. Methods are the actions that can be performed on or by the object.
    • An intrinsic control is built into the Visual Basic environment. The control is available to the developer at anytime and will always be included with the delivered application, even if it is not explicitly used in the application.
    • An ActiveX control is a component that is added to the Visual Basic environment.

      More on ActiveX from Microsoft.

     
    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Database Connections

      There are several ways to define a connection to a database. It is a good idea to put connection information in an include file (such as file conn.inc):

      <% strConn = "DRIVER=Microsoft Access Driver (*.mdb); _
      DBQ=" & Server.MapPath("x.mdb") %>


        A DSN can be created by running a registry update (.reg) file such as this from ASP101 to add a DSN named "paging":
        Windows Registry Editor Version 5.00
        
        [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\paging]
        "Driver"="C:\\WINNT\\System32\\odbcjt32.dll"
        "DBQ"="C:\\Inetpub\\wwwroot\\paging\\inc\\nw.mdb"
        "Description"="paging"
        "DriverId"=dword:00000019
        "FIL"="MS Access;"
        "SafeTransactions"=dword:00000000
        "UID"=""
        
        [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\paging\Engines]
        
        [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\paging\Engines\Jet]
        "ImplicitCommitSync"=""
        "MaxBufferSize"=dword:00000800
        "PageTimeout"=dword:00000005
        "Threads"=dword:00000003
        "UserCommitSync"="Yes"
        
      This method requires a DSN (Data Set Name) to be defined by an administrator using the web server's ODBC Admin utility. So this is why use of a ODBC connection string often results in the dreaded: 'Unable to open registry key' or 'Unspecified Error' messages.

      Alternately, a DSN-Less Connection is defined by supplying the precise full file path to the physical database:

      "DRIVER={Microsoft Access Driver (*.mdb)}; _
      DBQ=D:\...\x.mdb;UID=admin;UserCommitSync=Yes; _
      Threads=3;SafeTransactions=0;PageTimeout=5; _
      MaxScanRows=8;MaxBufferSize=2048; _
      FIL=MS Access;DriverId=25;DefaultDir=`

      Using the native OLEDB for Office 2000:

      "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
      & Server.MapPath("my.mdb") & ";Password=whatever;"

      Ultimately, connection to a SQL Server:

      "Provider=SQLOLEDB;Data Source=10.2.1.214;" _
      & "Initial Catalog=samples;User Id=samples;Password=password;" _
      & "Connect Timeout=15;Network Library=dbmssocn;"


    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Connection Strings

      Prior to using the ADO data control, ConnectionString and the RecordSource properties must be set to identify the data that is available to the bound controls on the form.

      The developer then adds a data aware control to the form and sets the DataSource property to be the data control. The DataField property of the data aware control is then set, from a list of the fields that are included in the RecordSource, to be the information that is to be displayed in that bound control. With VB 6.0, the Data Form Wizard only works with ADO objects.

      The command type adCmdText allows the developer to enter an SQL command to identify the information that is to be made available from the data control. This SQL command is very flexible in allowing us to specify the data that we want to manage.

      The command type adCmdTable allows the developer to name the table in the data source that will be made available from the data control. When this option is selected all of the records and all of the field in each record will be available through the data control.


    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Remote Method Invocation - Remote Object Calls

      RMI Both RPC and RMI use custom ports not typically used by web-based applications. So firewalls proxy servers need to be configured to use them (a hassle in corporations).

    • Microsoft has defined its DCOM (Distributed Component Object Model) by using its RPC (Remote Procedure Call) protocol over the TCP HTTP protocol. The syntax of a DCOM call is

      [Provider=MSDASQL;]
      {DRIVER=driver; SERVER=server } | { DSN=name | FileDSN=filename } ;
      [DATABASE=database;] Uid="sa"; PWD="password

    • Java's Remote Method Invocation (RMI) loads Java (not C) bytecode (classes) stored remotely on a server. This allows new types (classes) to be remotely introduced into a client JVM without re-compilation. RMI enables an object running in a client JVM to invoke methods on an object running in another Java VM.

      A parameter in an RMI call is passed by value. The parameter in most cases is either be a primitive type, or it implements Serializable. However, a reference to a remote object may also be passed in an RMI call; but in this case it must implement java.rmi.Remote.

      Among its limitations, a large percentage of Internet surfers can't use RMI applets in their browser because of differences in internet browser support for RMI. Netscape for the Macintosh does not support RMI at all. Navigator On Windows does not support HTTP tunneling for users connected through a proxy server. Internet Explorer 4/5 requires a patch to add missing classes.

      From Javasoft's RMI Tutorial Trail

      RMI client apps extend the java.rmi.Remote interface (which throws java.rmi.RemoteException).

      RMI applications (not applets) begin by installing the Java Security Manager:

      System.setSecurityManager(new java.rmi.RMISecurityManager());

      RMI clients obtain objects by first calling the simple naming service of a RMI Registry server using standard port 1099.

      rmi://48.29.166.171:1099/

      The client then binds (associates) a name with the remote object.

        java.rmi.Naming.rebind("DB1", db);

      The client then looks up remote objects by a name.

      try
      {
      centralWarehouse = (Warehouse)Naming.lookup("central_warehouse");

      This is not multi-lingual.

      In the RMI deployment environment, requests are sent to a client stub object. The stub object marshals a network request to a server skeleton object, which returns an object through the client stub.

      This obtains a stub referencing the remote object. Thus, Java class bytecodes are dynamically loaded when needed.

      EJB's use RMI over IIOP.

      Server objects offering remote methods extend java.rmi.UnicastRemoteObject.




    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen CORBA

    • Under the CORBA Common Object Request Broker Architecture) 2.0 standard published in December 1994 by the OMG (Object Management Group), clients can manipulate objects (data or programs) no matter where they are located or what programming language was used to design them.
    • A variety of languages (C, C++, Java, Ada, LISP, Python, and even COBOL) can support CORBA because at run-time, clients invoke methods of platform-independent object instances anywhere on the internet by using an ORB (Object Request Broker) object bus process on servers. This, for example, allows a Java GUI applet to talk with a LISP parser engine:

      • The General Inter-ORB Protocol (GIOP) defines the format of these messages.
      • The Internet Inter-ORB Protocol (IIOP) defines the transport layer communication protocol for how IIOP maps GIOP messages to TCP/IP messages.
      • The actual implementation of objects can reside anywhere because clients have no direct connection to them.

     
    Go to Top of this page.
    Previous topic this page
    Next topic this page

      Set screen How CORBA Works

      ORB Architecture
    • It is the object adapter which actually retrieves or updates the current values for the attribute in implementations.
    • The ORB acts as a traffic cop directing where requests should be routed to implementations contained within itself or to another ORB running on another machine.
    • When a request reaches the ORB for which it is intended, the request is passed to an object adapter . The portable object adapter (POA) and its predecessor, the basic object adapter (BOA), form a link between an object's implementation and its presence on the ORB.
    • ORBs maintain an interoperable object reference (IOR) for every object it brokers. The IOR is a global identifier string that identifies the machine on which its associated object is located and the interfaces that the object supports.

      CORBA

    • But instead of opening the server's IOR file, individual Java object interfaces are exposed for access by others over the Internet if they have been successfully registered with Common Object Services (COS) Naming Service.
    • Clients request data from an object through access of its attributes (C++ public member variables) or through access of an object's methods (similar to C++ public member functions which have multiple return values without pointers).
    • Requests are written in the CORBA Interface Definition Language (IDL) which is recognized by the CORBA Application Programming Interfaces (API) software on various hardware platforms.

      CORBA

    • IDL compilers turn IDL into files which stubs and skeletons reads. The client application uses stubs to make calls to server objects. The skeleton receive requests from the ORB, call the proper implementation, and return the results.
    • Parameters and return values are sent in GIOP messages using the Common Data Representation (CDR) protocol This protocol defines how IDL primitives are represented in a text-based format.
    • Datasinks hold data objects which can be accessed globally within an application environment.
    • CORBA Trading Services allows clients to find objects based on their properties.
    • Product Data Management (PDM) Enablers provide for interface with devices in manufacturing, telecommunications, medical, and financial industries.
    • Several vendors provide ORB Java implementation classes and associated IDL to Java compilers.
      • Alan Noble makes comments on his list of ORB's.
      • Tom Valesky lists free ORB's.
      • Inprise/Borland/Visigenic
      • IONA offers its OrbixCOMet Desktop to bridge between Microsoft COM over DCOM to their Orbix CORBA over IIOP.
      • Expersoft's PowerBroker ORB provides the communications backbone with which different object models (C++, Smalltalk, and OLE/COM) can co-exist within one enterprise system.
      • The CORBA architecture for IBM mainframes are defined by IBM's System Object Model (SOM) and Distributed System Object Model (DSOM).
      • BEA ObjectBroker is a CORBA-compliant object request broker that was acquired by BEA Systems from Digital Equipment Corporation in February of 1997. BEA has developed a new, mission-critical Object Transaction Manager (OTM) known as BEA M3 that was announced on June 2, 1998. This product is based upon the best of BEA TUXEDO, the leading open systems distributed transaction middleware, and BEA ObjectBroker.

      Java Development tool vendors such as Aptivity provide wizards to insert and remove fully qualified CORBA object instance declarations and references. For example, Aptivity provides the abCORBAManager class in its progress.aptivity.client package.

      CORBA interface constant reference:

        Inventory.StockRoom.LOCAL_TYPE

       
    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Microsoft's COM - Component Object Model architecture

    • Microsoft competes with CORBA with its Microsoft Transaction Server (MTS) -- running the Distributed Transaction Coordinator (DTC) service.
    • MTS comes bundled as part of the NT4 Option Pack, is an integral part of Microsoft operating system after that.
    • In October 1996 Microsoft formed the Active Group under the Open Group to guide the evolution of ActiveX and COM. ( David Chappell's story).
    • COM is a binary standard rather than COBRBA's software standard.
    • The lifetime of a COM object is managed by reference counting at the binary level with Addref/Release commands.
    • Unlike CORBA, COM includes local implementations (DLL's) such as those used by Windows, Internet Explorer, and Microsoft Office.
    • COM offers single inheritance vs. CORBA's multiple inheritance.
    • COM supports "aggregation", where several objects combined together appear as one.
    • Unlike CORBA, COM has security features.

    • COM+ (COM Plus) supports pooling.

    • ORB vendors (such as IONA's Object Transaction Monitor) support COM with CORBA.
    • Software AG has DCOM For The Enterprise (FTE) on UNIX/Solaris.

    • Level 8's FalconMQ Bridge sends messages between IBM MQ Series message queue queues and MSMQ message queues.
     

  • Microsoft's COM Site
  • Microsoft's ActiveX SDK FAQ
  • The Microsoft-sponsored Active Group ActiveX.org provides COM interfaces for several platforms (Solaris, Digital UNIX, VMS, etc.)

  • Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen LoadRunner COM Script

    Here is a sample script generated by VuGen against a login to the sample COM flight application:

    Action()
    {
    	{
    	int int_var1 = lrc_int("100A");
    	int int_var2 = lrc_int("A100");
    	lr_output_message("int 100A=%d, A100=%d", 
    		int_var1,
    		int_var2);
    	}
    
    	{
     	uhyper uhyper_var1 = lrc_uhyper("650000"); 
    	}
    
    	{
    	// Create a BSTR which may include nulls:
    	BSTR bstr0 = lrc_BSTR1("abc\x00def\x00\x00ghi", 12); 
    
    	// Create a BSTR which does not include nulls:
    	BSTR bstr1 = lrc_BSTR("abc\x00def\x00\x00ghi"); 
    	BSTR bstr2 = lrc_get_bstr_sub(bstr1, 7); 
    
    	lrc_print_bstr(bstr0); /* prints "abc\x00def\x00\x00ghi" with nulls */ 
    
    	lr_output_message("BSTR Length=%d, First 7=%s (cut off by terminator)", 
    		lrc_get_bstr_length(bstr0),
    		lrc_get_bstr_sub(bstr0, 7));	
    	}
    
    	{
    	// Convert ASCII string "true" into a Boolean variant:
    	VARIANT_BOOL true_var = lrc_bool("true"); 
    	VARIANT_BOOL false_var = lrc_bool("false"); 
    
    	// Create an empty variant: 
    	VARIANT empty_var = lrc_variant_empty(); 
    	VARIANT null_var  = lrc_variant_null(); 
    
    	// Create a new variant containing an existing variant:
    	VARIANT var0 = lrc_variant_short("53"); 
    	VARIANT var1 = lrc_variant_variant_by_ref(&var0);
    	VARIANT var2 = lrc_variant_BSTR("HELLO"); 
    
    	// Retrieve the GUID of the Istudent interface named object
    	// VuGen to retrieve identifiers needed for retrieving interface identifiers and PROGIDs of COM objects to be used in COM communications: 
    	GUID pClsid = lrc_GUID("student.student.1"); 
    
    	// Fill a byte array with strings of characters:
    	ByteArray var; 
    	var = Create3DByteArray(0, 2, 0, 3, 0, 4); 
    		Fill3DByteArray(var, 0, 0, "abcd", 4); 
    		Fill3DByteArray(var, 0, 1, "efgh", 4); 
    		Fill3DByteArray(var, 0, 2, "ijkl", 4); 
    		Fill3DByteArray(var, 1, 0, "mnop", 4); 
    		Fill3DByteArray(var, 1, 1, "qrst", 4); 
    		Fill3DByteArray(var, 1, 2, "uvwx", 4); 
    
    	// Save variant:
    	lrc_save_VARIANT("pvar0",var0); 
    	lrc_save_VARIANT("pvar1",var1); 
    
        lrc_print_variant(var2); 
    		// Example: Variant of type: BSTR ,with value: HELLO
    
    	}
    	return 0;
    
    }
    

     
    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Microsoft COM+ Performance Counters by LoadRunneranother page on this site

      LoadRunner provides (for an additional license) these measurement counters:

      Aspect Metric Description Notes
      Authentication Authenticate Frequency of successful method call level authentication. When you set an authentication level for an application, you determine what degree of authentication is performed when clients call into the application.
      Authenticate Failed Frequency of failed method call level authentication.
      Application Events Activation Frequency of application activation or startup.
      Shutdown Frequency of application shutdown or termination.
      Thread Events Thread Start Rate at which single-threaded apartment (STA) thread for application have been started.
      Thread Terminate Rate at which single-threaded apartment (STA) thread for application have been terminated.
      Work Enque Event sent if a work is queued in single thread apartment object (STA). Note: These events are not signaled/sent in Windows Server 2003 and later.
      Work Reject Event sent if a work is rejected from single thread apartment object (STA). Note: These events are not signaled/sent in Windows Server 2003 and later.
      Transaction Events Transaction Duration Duration of COM+ transactions for selected application.
      Transaction Start Rate at which transactions have started.
      Transaction Prepared Rate at which transactions have completed the prepare phase of the two-phase protocol.
      Transaction Aborted Rate at which transactions have been aborted.
      Transaction Commit Rate at which transactions have completed the commit protocol.
      Object Events Object Life Time Duration of object existence (from instantiation to destruction).
      Object Create Rate at which new instances of this object are created.
      Object Destroy Rate at which instances of the object are destroyed.
      Object Activate Rate of retrieving instances of a new JIT-activated object.
      Object Deactivation Rate of freeing JIT-activated object via SetComplete or SetAbort.
      Disable Commit Rate of client calls to DisableCommit on a context. DisableCommit declares that the object's transactional updates are inconsistent and can't be committed in their present state.
      Enable Commit Rate of client calls to EnableCommit on a context. EnableCommit declares that the current object's work is not necessarily finished, but that its transactional updates are consistent and could be committed in their present form.
      Set Complete Rate of client calls to SetComplete on a context. SetComplete declares that the transaction in which the object is executing can be committed, and that the object should be deactivated on returning from the currently executing method call.
      Set Abort Rate of client calls to SetAbort on a context. SetAbort declares that the transaction in which the object is executing must be aborted, and that the object should be deactivated on returning from the currently executing method call.
      Method Events Method Duration Average duration of method.
      Method Frequency Frequency of method invocation.
      Method Failed Frequency of failed methods (i.e. methods that return error HRESULT codes).
      Method Exceptions Frequency of exceptions thrown by selected method.

      Caution! If you want to display more than 20 of these counters, see Mercury problem ID 26871 to change the ini file.

     
    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Portions ©Copyright 1996-2014 Wilson Mar. All rights reserved. | Privacy Policy |

    Related:

  • Web Development Project Plans
  • Application Development
  • Web Development Tools
  • Clients/Browsers
  • The Java Platform
  • Java Programming
  • VB Programming

  • How I may help

    Send a message with your email client program


    Your rating of this page:
    Low High




    Your first name:

    Your family name:

    Your location (city, country):

    Your Email address: 



      Top of Page Go to top of page

    Thank you!