1.What is COM?

Ans:

        ‘COM’ stands for ‘component object model’ .It is a specification from Microsoft.  COM is language-independent but works only in windows platform.

Though ported to MAC and DEC  unix, it has not been  adopted in those platform much.

 

i.  Is COM platform-neutral?

ii. Is COM language-neutral?

        

         * DEC…..Digital Equipment Corporation.

         * MAC…..Macintosh. (Apple computers).

         * (aside) do you know the various UNIX flavours?

             Unix got splintered.

             There are various versions of unix.

 

*******************************************************************

 

2. What is ‘DCOM’?

Ans:

       ‘DCOM’ stands for ‘Distributed COM’ .It is similar in concept to RMI (sun micro Systems ) and CORBA (OMG).

 

       * OMG…..Object Management Group

       * RMI……Remote Method Invocation

       * CORBA…Common Object Request Broker Architecture.

 

        OMG was formed in 1989.It is an association of over 800 software and hardware   giants . It is a non profit organization.

 

*******************************************************************

 

 

3. What are the three aspects of ‘COM’ from the user’s perspective?

Ans:

       a) OLE Document       /AX Document.

       b) OLE Control           /AX Control.

       c) OLE Component    /AX Component.

 

*******************************************************************

 

4. What is the difference between OLE document and AX document?

Ans:

       OLE document is a compound document in a container. A container can contain   more than one ‘OLE document’ but it can contain only one AX document because an AX document occupies the entire space of the container screen. (ex) A  ‘Word’ document opened in Internet Explorer.

 

       * AX document is always a ‘Full Server’

       * ‘Linking’ is NOT allowed in AX-documents.

 

       # what is ‘linking’?

Consider an Excel doc embedded in Word  . when the original Excel doc is edited, the  embedded  Excel doc also change accordingly.

 

*******************************************************************

 

5. Explain the terms: (with reference to OLE documents)

Ans:

       i)    Container

       ii)   Server

       iii)  Mini -Server

       iv)  Full -Server

       v)   both server & container

       vi)  automation.

 

Let us consider a case where an ‘Excel SpreadSheet’ is embedded in a ‘Word’ document.

 

In this case, ‘Word’ is the container.

                    ‘Excel’ is the server.

 

A ‘Full server’ can work both as a stand alone and as embedded program. (ex) Excel.

 

A ‘Mini server’ can work only as embedded program.It cannot run independently. (ex) ‘Word art’.

 

WORD can run ‘both as server and container’. Excel also can run like this.

 

Automation’ means that the methods and properties of the server can be manipulated  by the client program ( container or automation controller ). by scripting. (ex) Excel spreadsheete can be manipulated by scripting.

 

     # what is VBA?

     Ans:

            VBA …’Visual Basic for Application’ is built into MS-OFFICE ‘97’ using this,we can automate many tasks by scripting. As a bonus ,we need not know how to write the scripts! The ‘Macro Recorder’ when turned on, will translate all our key actions into equivalent script which can be reused by us. It is for similar purpose that we find vbscript in ‘Visual C++’ IDE.

 

      * how will you give a demo for vba in Excel?

       Ans:

       Start Excel à menubaràtoolsàmacroàvbaàmenubaràinsertàuserform.

       

    Userform & toolbox appear.

    Bring button & write code on button1 as in vb.

    Msgbox(“hello”)

    Click the ‘run’ button in toolbar to test. It works!

 

*******************************************************************

 

6. What is ‘OLE-2’ ? In which year was it formulated?

Ans:

       OLE-2 is a specification from Microsoft with the following features.

i.                     COM

ii.                   Drag and drop

iii.                  Clipboard

iv.                 Embedding

v.                   linking

vi.                 in place editing

vii.                Ole automation

viii.              Ole controls

ix.                 Ole documents

x.                   Monikers

xi.                 Structured storage

xii.                UDT (Uniform Data Transfer)

(evidently, the features are not mutually exclusive).

The specification was released in 1992).

 

*******************************************************************

 

7. What is the difference between ‘OLE Control’ and ‘AX Control’ ?

Ans:

       ‘OLE Controls’ are 32 bit controls meant for desktop environment. But  they depend on a very heavy library and so were found unsuitable for downloading from web. So Microsoft came out with AX Controls .These are preferably based on ATL. and are compact so that they can be easily downloaded from web.

 

However, an AX Controls need not necessarily be based on ATL. Nowdays AX Control means OLE Control as well.

 

       * ATL…..Active Template Library.

          ( ATL is based on STL.(Standard Template Library.)

       * STL..( proposed by Hewlett – Packard company)

          ( C++ extensions for ‘ collection’ classes).

 

*******************************************************************

 

8. What do you mean by ‘collection’ classes?

Ans:

       In  jdk1.2 , we have come across collection classes (ie) List, Set, Map, etc, These are similar to vectors, hashtables and arrays. The same set of functions are used in all these data types. Hence the concept of template.

 

        * What is Template?

Consider a function as follows.

======================

int add(int n1 , int n2)

{

  return n1+n2

}

======================

 

Let there be another function as follows.

=============================

Float add ( float f1, float f2)

{

  return        f1+f2;

}

=============================

 

When we look at these functions, we find that the patterns is same, but for the data type.

 

So we can write the template as follows.

   Type add ( type a, type b)

{

  Return a+b;

}

==============================

 

*******************************************************************

 

9. What in your opinion is the difference between AX Controls & AX Component?

Ans:

       AX Controls (similar in function to javabeans) has methods , properties and events.

 

       AX Components generally have methods and properties but a component can be written to generate ‘event’ too  !. But the event is not generated by user action.A component is generally invisible.A component is ‘encapsulated functionality’ of

Some business logic.

 

      AX controls on the other hand are generally visible components. (but not

necessarily).

 

      We can say that AX controls are used in client – side container with which the user interacts. But a component can be either in client – side or in server – side .(ex) standard javabean is similar to AX control.

   

       But JSP bean / ASP component are in server – side.

 

*******************************************************************

 

10. What is the difference  between

       a.) VBX control   b.) OCX control   c.) AX control

Ans:

       VBX……i6 bit controls written in c++ for use in VB (Windows 3.1)

    

       OCX……32 bit controls based on com specification , can be used in all win 32 programs.

 

       AX…32 bit controls based on COM  but lean controls preferably written in ATL.

 

*******************************************************************

 

11.What are the languages in which com – servers can be developed?

Ans:

       COM – servers can be developed in any of the following languages

                                                         i.      C++

                                                       ii.      ATL wizard (c++)

                                                      iii.      MFC wizard (c++)

                                                     iv.      VB6

                                                       v.      VJ++ 1.1 (visual j++ 1.1 )

                                                     vi.      VJ++ 6 (visual j++ 6)

                                                    vii.      Delphi 6

 

*******************************************************************

 

12. What do you know of Delphi’ , ‘Borland’ & ‘Anders Hjelsberg’ ?

Ans:

       Delphi is a powerful language similar to VB but based on object PASCAL 

Language. Delphi is from ‘Borland International’.

      

       We are familiar with ‘ Turbo  C & C++’    These compilers are from Borland International. ‘Turbo’ is just a brand name. Actually there are two compilers from Borland. (ie) ‘Borland C’ and ‘Turbo C’. ‘Borland C’ is more powerful and costlier while ‘Turbo C’ compiler is adequate and low – priced.

 

      Till a few years back  .Borland products were a serious challenge to Microsoft.

 

===========================================================

 

        # Anders Hjelsberg was the designer or Delphi.

So. Microsoft absorbed him and entrusted him with the creation of Visual J++. ++ & subsequently C#. (C-sharp).

 

===========================================================

 

        ‘INPRISE’ is famous for ‘VISIBROKER’ (CORBA idl compiler)too.

Formerly, ‘VISIBROKER’ was a product from ‘VISIGENIC’.

In 1997, Borland acquired ‘VISIGENIC’.

        

         Borland is famous also for its ‘ Java IDE ‘ named ‘J-BUILDER’    , a heavy program. It hogs memory .To work well. it requires atleast 128 mb of memory.  But it is a powerful java development IDE. It is written in pure java and programs developed in J-BUILDER are platform – independent.

    

         Unlike , Microsoft VJ++ , it does not introduce platform – specific features

& thereby spoil the spirit of java.(platform – independence).J- Builder is  so good that ORACLE CORPORATION  has modeled its J-DEVELOPER almost entirely on J-BUILDER.

 

        Caffine ‘ also is from visigenic.

( a program which enables java programmers to write corba – compliant software in java without using omgidl).

 

*******************************************************************

 

13. OMG – IDL? What is it?

Ans:

       OMG-IDL stands for ‘ OMG Interface  Definition Language’. It looks like C but is not a regular programming language at all. It is just a descriptive tool. IDL ‘compilers’ from vendors like ‘VISIGENIC’ , ‘ORBIX-WEB’ , ‘JACK-ORB’ translate the idl file into java/c++/ etc and also generate the stub/skeleton files.

 

Caution:

             In Corba and RMI , stub is in ‘local’ end and skeleton is in ‘ remote’ end.

             But in Microsoft parlance , ‘stub’ is in remote side and ‘proxy’ is in client side.

 

*******************************************************************

 

14. Differentiate between  OMG – IDL and MICROSOFT ODL/IDL ?

Ans:

       Just as OMG offers IDL ,  Microsoft also specified its own ODL. (Object Definition Language).

       IDL (Interface Definition Language) is the term appilied to ATL environment and ODL refers to MFC environment.

 

#Why is Microsoft having two language  ‘IDL’ and ‘ODL’ for the same purpose?

Ans:

       IDL has its roots in RPC of DCE. Com and Dcom are based on DCE.Microsoft

Adopted the GUID concept of RPC and provided file extension *.ODL. There was a

Program known as ‘myTypLib’ to create  ‘TYPE LIBRARY INFORMATION’.

       Subsequently, the extension was changed as ‘IDL’. And  a new program MIDL has replaced ‘myTypLib’.

 

*******************************************************************

 

14. What is ‘GUID’?

Ans:

      GUID stands for ‘Globally Unique Identifier’ It had its origin in DCE of OSF. It is a requirement of ‘Distributed Computing ‘.As already mentioned , COM is in many ways similar to RMI/CORBA, because it is meant for inter – process communication (mostly within  a single machine ). Just like RMI/CORBA , Com also begins with ‘INTERFACE’.

 

      NOTE: We can use COM for ‘remote server’ also.

 

# What is an ‘interface’?

Ans:

       An ‘Interface’ is a set of function declaration without implementation details.

 

(ex)  String getnews(String a);

(return value is String.

Function name is ‘getnews

Parameter is String a)

 

     To make the interface unique, the OSF-DCE-RPC engineers devised a system by defining UUID. (Universally Unique Identifier).It is an 128 – bit data structure. It combines the current time in 100 nanoseconds intervals (Since 1582 AD). The network address of the computer (which is guaranteed to be unique) and other ancillary information.

 

      If our computer has no network adapter and hence no network address. RPC provides a suitable algorithm to uniquely identify our computer.

   

      Microsoft adopted the same scheme but called it GUID (Globally unique identifier).

That explains the difference between UUID and GUID.

 

*******************************************************************

 

15. What is an ‘IDL’ ? Why is it necessary?

Ans:

       COM is meant to be a binary standard (ie) it can be written in any language and called from any other language – environment provided it supports COM. Moreover

Microsoft wanted COM to be platform – independent also, like CORBA. Whenever such a requirement is stipulated, we begin with an interface definition file which is a kind of general description of the interface, not tied to any language / platform , because , whenever inter-process  calls are encountered, ‘marshalling’ and ‘unmarshalling’ of data from the client – side to the server – side becomes necessary. To do this manually is very difficult and error prone. The recommended method is to write the IDL file and have it compiled by a suitable ‘compiler’ which translates the file to a suitable real language and also automatically generates the ‘stub’ and ‘proxy’ files.

    

      That is why, while an in-process component may not require an ‘idl’ file, a ‘local server’ requires an idl file since process boundary is being crossed, though within the same machine, and though the platform and language in the ‘server’ side is the same as in ‘client’ side. (Strictly speaking , even an ‘in – process’ server may require an idl depending on the threading model chosen.)

 

      In CORBA , the problem of marshalling of parameters is even more difficult since it has to be platform  - independent as well as language – independent.That is why, CORBA always begins with IDL.

 

 

       ( In practice  however , writing the idl file for really big jobs is not easy and so jdk1.3 has provided rmiiiop along the same lines of ‘caffiene’ so that we can avoid writing idl.)

 

        Similarly , in  COM ,creation of idl file had been automated by wizards. When we use VB,VJ,VJ++6,ATL and MFC wizards for creating components, a lot of details are hidden from the developer and things we will have to carry out all these operations ourselves.

 

*******************************************************************

 

16. Explain the concept of interface in COM ?

Ans:

       A COM object exposes its functionality through interface ( as in RMI and CORBA ). An Interface is just a function declaration having  return type, function name and parameter types. There is no implementation. To implement the interface , a class is created and an instances of this class is the COM objects! (all this is very much similar to RMI).

 

       For a COM object to be available to the client applications, it has to be registered in the System Registry.

 

      (In RMI , We register the remote ‘objects’ , but in COM , it is the ‘class’ that is registered!).

 

     (Secondly , the registry is ‘remote registry’ in RMI but in COM  it is local registry.)

 

     A class factory creates objects & keeps account of running instances of the COM class.

 

*******************************************************************

 

17. What is ‘Iunknown’?

Ans:

      Just as in RMI , we derive our interface from ‘Remote’ , all interface in COM are derived from ‘Iunknown’ . The Iunknown ‘ class has three methods namely

      QueryInterface

      AddRef()

      Release()

 

*********************************************************************************************