You are on page 1of 18

KRISTU JAYANTI COLLEGE (AUTONOMOUS) BANGALORE

IV SEM MCA

MCA204A41: Middleware Technologies Question Bank

1. Define software Architecture? Explain the properties of Components in detail


2. Explain the .NET framework with neat diagram
3. Explain the J2EE framework with neat diagram
4. Write short notes on Components, Objects, Callback and Interface
5. What are directory services? Explain the advantages of directory services
6. Define Thread? Explain events and connections in java beans
7. Explain the advantages and disadvantages of java beans
8. Describe about Introspection and reflection in Java beans
9. Write about EJB
10.Explain the steps for creation of Jar files
11. Brief about stub and skeleton in RMI
12.What is RMI? Explain the architecture of RMI with neat diagram
13.Write a short note on RMI-IIOP
14.Define CORBA? Explain the Components of CORBA in detail
15. Explain the architecture of CORBA in detail
16.What is ORB? Explain the role of ORB
17.Write brief note on IDL
18.What is Adapter? Explain different types of Adapter in CORBA
19. Explain about application server in CORBA
20. Explain Model drive architecture
21.Explain the MDA specification with neat diagram

22.Define COM? Explain the interface in COM


 COM is a mechanism that was developed to allow people to distribute
binaries that could be reused even if the caller was using another vendor's C++
compiler or (ultimately) a different language altogether. ATL is a perfect
example of this. While source-level reuse works fine, it only works for C++. It
also introduces the possibility of name collisions, not to mention bloat from
having multiple copies of the code in your projects.
 COM solves all these problems by defining a binary standard, meaning
that COM specifies that the binary modules (the DLLs and EXEs) must be compiled
to match a specific structure.
 Each COM component provides an implementation of one or more interfaces. Those
interfaces are defined in a language-neutral manner using the Interface Definition
Language (IDL).
Interface in COM
 An interface is actually a contract that consists of a group of related function
prototypes whose usage is defined but whose implementation is not. These
function prototypes are equivalent to pure virtual base classes in C++
programming.

 An interface definition specifies the interface's member functions,


called methods, their return types, the number and types of their parameters,
and what they must do. There is no implementation associated with an
interface.

 An interface implementation is the code a programmer supplies to carry out


the actions specified in an interface definition. Implementations of many of
the interfaces a programmer can use in an object-based application are
included in the COM libraries. However, programmers are free to ignore these
implementations and write their own. An interface implementation is to be
associated with an object when an instance of that object is created, and the
implementation provides the services that the object offers.

23.What is DCOM
• DCOM (Distributed Component Object Model) is a set of Microsoft concepts
and program interfaces in which client program object s can request services from
server program objects on other computers in a network.
• DCOM is based on the Component Object Model (COM), which provides a
set of interfaces allowing clients and servers to communicate within the same
computer
• DCOM can also work on a network within an enterprise or on other networks
besides the public Internet. It uses TCP/IP and Hypertext Transfer Protocol . DCOM
comes as part of the Windows operating systems.
• DCOM is or soon will be available on all major UNIX platforms and on
IBM's large server products. DCOM replaces OLE Remote Automation.
• DCOM is generally equivalent to the Common Object Request Broker
Architecture ( CORBA ) in terms of providing a set of distributed services. DCOM
is Microsoft's approach to a network-wide environment for program and data
objects.
24.Compare and contrast between CORBA and DCOM

25.What is threading

26.Explain various threading apartment model in COM

There are two types of apartments: single-threaded apartments, and multi-threaded


apartments.

 Single-threaded Apartments --

Single-threaded apartments consist of exactly one thread, so all COM


objects that live in a single-threaded apartment can receive method calls only
from the one thread that belongs to that apartment.
All method calls to a COM object in a single-threaded apartment are
synchronized with the windows message queue for the single-threaded
apartment's thread.

Using single-threaded apartments (apartment model) offers a message-


based paradigm for dealing with multiple objects running concurrently. It allows
you to write more efficient code by allowing a thread that is waiting for some
time-consuming operation to allow another thread to be executed.

Each thread in a process that is initialized as apartment-model, and which


retrieves and dispatches window messages, is a single-threaded apartment thread.
Each of these threads live within its own apartment. Within an apartment,
interface pointers can be passed without marshaling. Thus, all objects in one
single-threaded apartment thread communicate directly. Interface pointers must
be marshaled when passed between apartments.

A logical grouping of related objects that all execute on the same thread, and so
must have synchronous execution could live on the same single-threaded
apartment thread. An apartment-model object cannot, however, reside on more
than one thread. Calls to objects in other processes must be made within the
context of the owning process, so distributed COM switches threads for you
automatically when you call on a proxy.

The inter-process and inter-thread models are similar. When it is necessary to


pass an interface pointer to an object in another apartment (on another thread)
within the same process, you use the same marshaling model that objects in
different processes use to pass pointers across process boundaries. By getting a
pointer to the standard marshaling object, you can marshal interface pointers
across thread boundaries (between apartments) in the same way you do between
processes.

 Multi-threaded Apartments –

Multi-threaded apartments consist of one or more threads, so all COM


objects that live in an multi-threaded apartment can receive method calls
directly from any of the threads that belong to the multi-threaded
apartment.

Threads in a multi-threaded apartment use a model called “free-threading''.


COM does not provide any synchronization of method calls to COM objects in a
multi-threaded apartment. In particular, this means that the COM object must
provide its own synchronization if needed.

In a multi-threaded apartment, all the threads in the process that have been
initialized as free-threading reside in a single apartment. Therefore, there is no need to
marshal between threads. The threads need not retrieve and dispatch messages because
COM does not use messages in this model.
Calls to methods of objects in the multi-threaded apartment can be run on any thread in
the apartment. There is no serialization of calls - many calls may occur to the same
method or to the same object simultaneously. Objects created in the multi-threaded
apartment must be able to handle calls on their methods from other threads at any time.

Multi-threaded object concurrency offers the highest performance and takes the best
advantage of multi-processor hardware for cross-thread, cross-process, and cross-
machine calling, since calls to objects are not serialized in any way. This means,
however, that the code for objects must provide synchronization in their interface
implementations, typically through the use of platform dependent synchronization
primitives. In addition, because the object doesn't control the lifetime of the threads that
are accessing it, no thread-specific state may be stored in the object (in Thread-Local-
Storage).

COM provides call synchronization for single-threaded apartments only. Multi-threaded


apartments (containing free-threaded threads) do not receive calls while making calls
(on the same thread). Multi-threaded apartments cannot make input synchronized calls.
Asynchronous calls are converted to synchronous calls in multi-threaded apartments.
The message filter is not called for any thread in a multi-threaded apartment.

To initialize a thread as free-threaded, call CoInitializeEx(),


specifying COINIT_MULTITHREADED.

Multiple clients can call an object that supports free-threading simultaneously from
different threads: In free threaded out-of-process servers, COM, through the RPC sub-
system, creates a pool of threads in the server process and a client call (or multiple
client calls) can be delivered by any of these threads at any time. An out-of-process
server must also implement synchronization in its class factory. Free threaded, in-
process objects can receive direct calls from multiple threads of the client.

The client can do COM work in multiple threads. All threads belong to the same multi-
threaded apartment. Interface pointers are passed directly from thread to thread within a
multi-threaded apartment so interface pointers are not marshaled between its threads.
Message filters (implementations of IMessageFilter()) are not used in multi-threaded
apartments. The client thread will suspend when it makes a COM call to out-of-
apartment objects and will resume when the call returns. Calls between processes are
still handled by RPC.

Threads initialized with the free-threading model must implement their own
synchronization.

27. Write a note on assemblies


Assemblies form the fundamental units of deployment, version control, reuse,
activation scoping, and security permissions for .NET-based applications. An
assembly is a collection of types and resources that are built to work together and
form a logical unit of functionality. Assemblies take the form of executable (.exe) or
dynamic link library (.dll) files, and are the building blocks of .NET applications.
They provide the common language runtime with the information it needs to be
aware of type implementations.
Assemblies have the following properties:

 Assemblies are implemented as .exe or .dll files.

 For libraries that target the .NET Framework, you can share assemblies
between applications by putting them in the global assembly cache (GAC).

 Assemblies are only loaded into memory if they are required. If they aren't
used, they aren't loaded. This means that assemblies can be an efficient way to
manage resources in larger projects.

 You can programmatically obtain information about an assembly by using


reflection.
 You can load an assembly just to inspect it by using the MetadataLoadContext
class in .NET Core and the Assembly.ReflectionOnlyLoad or
Assembly.ReflectionOnlyLoadFrom methods in .NET Core and .NET
Framework.

Assemblies provide the common language runtime with the information it needs to be
aware of type implementations. To the runtime, a type does not exist outside the context
of an assembly.

An assembly defines the following information:

Code that the common language runtime executes. Note that each assembly can have
only one entry point: DllMain, WinMain, or Main.

Security boundary. An assembly is the unit at which permissions are requested and
granted. For more information about security boundaries in assemblies, see Assembly
security considerations.

Type boundary. Every type's identity includes the name of the assembly in which it
resides. A type called MyType that is loaded in the scope of one assembly is not the
same as a type called MyType that is loaded in the scope of another assembly.
Reference scope boundary. The assembly manifest has metadata that is used for
resolving types and satisfying resource requests. The manifest specifies the types and
resources to expose outside the assembly, and enumerates other assemblies on which it
depends. Microsoft intermediate language (MSIL) code in a portable executable (PE)
file won't be executed unless it has an associated assembly manifest.

Version boundary. The assembly is the smallest versionable unit in the common
language runtime. All types and resources in the same assembly are versioned as a unit.
The assembly manifest describes the version dependencies you specify for any
dependent assemblies.

Deployment unit. When an application starts, only the assemblies that the application
initially calls must be present. Other assemblies, such as assemblies containing
localization resources or utility classes, can be retrieved on demand. This allows apps to
be simple and thin when first downloaded.

Side-by-side execution unit.

28.Write a notes on reflection

.NET Framework's Reflection API allows you to fetch type (assembly) information at runtime
programmatically. We can also achieve late binding by using .NET Reflection. At runtime, the
Reflection mechanism uses the PE file to read information about the assembly. Reflection enables
you to use code that is not available at compile time. .NET Reflection allows an application to
collect information about itself and also to manipulate on itself. It can be used effectively to find all
types in an assembly and/or dynamically invoke methods in an assembly. This includes information
about the type, properties, methods, and events of an object. With Reflection, we can dynamically
create an instance of a type, bind the type to an existing object, or get the type from an existing
object and invoke its methods or access its fields and properties. We can also access attribute
information using Reflection.

Using Reflection, you can get any kind of information which you can see in a class viewer; for example,
information on the methods, properties, fields, and events of an object.

The System.Reflection namespace and the System.Type class plays a very important role in .NET
Reflection. These two work together and allow you to reflect over many other aspects of a type.

The System.Reflection namespace contains the classes and interfaces that provide a managed


view of loaded types, methods, and fields, with the ability to dynamically create and invoke types; this
process is known as Reflection in .NET framework. We will take a look at some of the commonly used
classed here:

Class Description

Assembly Represents an assembly, which is a reusable, versionable, and self-describing


building block of a Common Language Runtime application. This class contains a
Class Description

number of methods that allow you to load, investigate, and manipulate an


assembly.

Performs Reflection on a module. This class allows you to access a given module
Module
within a multi-file assembly.

This class allows you to discover numerous details behind an assembly's identity.
An assembly's identity consists of the following:
 Simple name
AssemblyName
 Version number
 Cryptographic key pair
 Supported culture

This class holds information for a given event. Use the EventInfo class to inspect
EventInfo
events and to bind to event handlers.

This class holds information for a given field. Fields are variables defined in the
class. FieldInfo provides access to the metadata for a field within a class, and
FieldInfo
provides dynamic set and get functionality for the field. The class is not loaded into
memory until Invoke or get is called on the object.

The MemberInfo class is the abstract base class for classes used to obtain


MemberInfo information about all members of a class (constructors, events, fields, methods, and
properties).

MethodInfo This class contains information for a given method.

ParameterInf
This class holds information for a given parameter.
o
PropertyInfo This class holds information for a given property.

The System.Type Class


The System.Type class is the main class for the .NET Reflection functionality and is the primary way
to access metadata. The System.Type class is an abstract class and represents a type in the Common
Type System (CLS).

It represents type declarations: class types, interface types, array types, value types, enumeration types,
type parameters, generic type definitions, and open or closed constructed generic types.

Use the members of Type to get information about a type declaration, such as the constructors,
methods, fields, properties, and events of a class, as well as the module and the assembly in which the
class is deployed.
There are tree ways to obtain a Type reference:
The System.Type class defines a number of members that can be used to examine a type's
metadata, a great number of which return types from the System.Reflection namespace.

You can split the properties implemented by Type into three categories:

1. A number of properties retrieve the strings containing various names associated with the class,
as shown in the following table:
Property Returns

Name The name of the data type.

FullName The fully qualified name of the data type (including the namespace name).

Namespac
The name of the namespace in which the data type is defined.
e
2. It is also possible to retrieve references to further type objects that represent related classes, as
shown in the following table:
Property Returns Type Reference Corresponding To

BaseType Immediate base type of this type.

The type that this type maps to in the .NET runtime (recall that
UnderlyingSystemTyp
certain .NET base types actually map to specific predefined types
e
recognized by IL).
3. A number of Boolean properties indicating whether this type is, for example, a class, an enum,
and so on.
Type Meaning in Life

o IsAbstract These properties (among others) allow you to


o IsArray discover a number of basic traits about the type
o IsClass you are referring to.
o IsCOMObject
o IsEnum
o IsGenericTypeDefinit
Type Meaning in Life

ion
o IsGenericParameter
o IsInterface
o IsPrimitive
o IsPublic
o IsNestedPrivate
o IsNestedPublic
o IsSealed
o IsValueType
o IsPointer

29.Brief about remoting in .NET


.NET remoting is an architecture which enables communication between different
application domains or processes using different transportation protocols,
serialization formats, object lifetime schemes, and modes of object creation.
Remote means any object which executes outside the application domain. The two
processes can exist on the same computer or on two computers connected by a
LAN or the Internet. This is called marshalling (This is the process of passing
parameters from one context to another.), and there are two basic ways to marshal
an object:

Marshal by value: the server creates a copy of the object passes the copy to the
client.
Marshal by reference: the client creates a proxy for the object and then uses the
proxy to access the object.

Remote objects are accessed through channels. Channels are Transport protocols for
passing the messages between Remote objects. A channel is an object that makes
communication between a client and a remote object, across app domain boundaries.
The .NET Framework implements two default channel classes, as follows:
 
HttpChannel: Implements a channel that uses the HTTP
protocol. TcpChannel: Implements a channel that uses the TCP protocol (Transmission
Control Protocol). Channel take stream of data and creates package for a transport
protocol and sends to other machine. A simple architecture of .NET remoting is as in Fig
1.

 
As Fig.1 shows, Remoting system creates a proxy for the server object and a reference to
the proxy will be returned to the client. When client calls a method, Remoting system
sends request thro the channel to the server. Then client receives the response sent by
the server process thro the proxy.
30.Write a short notes on Active X Control and OLE containers

31. Define component oriented programming


Component-oriented programming enables programs to be constructed from prebuilt
software components, which are reusable, self-contained blocks of computer code.
These components have to follow certain predefined standards including interface,
connections, versioning, and deployment.
Components come in all shapes and sizes, ranging from small application
components
that can be traded online through component brokerages to the so-called large
grain components that contain extensive functionality and include a company’s
business
logic. In principle, every component is reusable independent of context, that is to
say, it should be ready to use whatever from wherever.
COP is to develop software by assembling components. While OOP emphasizes
classes and objects, COP emphasizes interfaces and composition. In this sense, we
could say that COP is an interface-based programming. Clients in COP do not need
any knowledge of how a component implements its interfaces. If interfaces
remain unchanged, clients are not affected by changes in interface implementations.

32.Explain the component framework in detail

33. What is cross-development environment


Cross-development denotes the compilation and building of applications on the host
system that will be run on the embedded system. Keeping these definitions in mind
will help you stay on track.

Below given figure shows the layout of a typical cross-development environment. A


host PC is connected to a target board via one or more physical connections. It is
most convenient if both serial and Ethernet ports are available on the target. Later
when we discuss kernel debugging, you will realize that a second serial port can be a
very valuable asset.
In the most common scenario, the developer has a serial terminal on the host
connected to the RS-232 serial port, possibly one or more Telnet terminal sessions to
the target board, and potentially one or more debug sessions using Ethernet as the
connection medium. This cross-development setup provides a great deal of
flexibility. The basic idea is that the host system provides the horsepower to run the
compilers, debuggers, editors, and other utilities, while the target executes only the
applications designed for it. Yes, you can certainly run compilers and debuggers on
the target system, but we assume that your host system contains more resources,
including RAM, disk storage, and Internet connectivity. In fact, it is not uncommon
for a target embedded board to have no human-input devices or output displays.

34.What is Component oriented programming?


Component-oriented programming provide a systematical way to achieve
dependable systems. Owing to the abstraction of components and systematic
integration of components, it is much easier to validate critical requirements and
verify safety for component-based systems. On the other hand, reusable components
have usually been tested through the validation process and real usage for a long
time and, therefore, their quality can be assured.
Component-oriented programming enables programs to be constructed from prebuilt
software components, which are reusable, self-contained blocks of computer code.
These components have to follow certain predefined standards including interface,
connections, versioning, and deployment.
Components come in all shapes and sizes, ranging from small application
components that can be traded online through component brokerages to the so-called
large grain components that contain extensive functionality and include a company’s
business logic. In principle, every component is reusable independent of context,
that is to say, it should be ready to use whatever from wherever.
COP is to develop software by assembling components. While OOP emphasizes
classes and objects, COP emphasizes interfaces and composition. In this sense, we
could say that COP is an interface-based programming. Clients in COP do not need
any knowledge of how a component implements its interfaces. As long as interfaces
remain unchanged, clients are not affected by changes in interface implementations.

35.Explain about Component Design and implementation tools.


Components design rests on the environmental specification usually given by a
component framework and an underlying component model. ï Component
development should use rapid application development methods to capture
requirements quickly within a working component system. The same environment is
used to prototype a component within a characteristic environment and implement
the component. ï Support for construction of models with little further input from
developers. ï Modeling and generator tools can take the marketing position of RAD
tools.
Component Tools

Component design rests on the environmental specifications – usually given by a


component framework and an underlying component (or object)model.Ideally,
component development should use rapid application development(RAD) methods
to capture requirements quickly within a working component system.The same
environment is used to prototype a component, within a characteristic environment,
and implement the component.

Support for the construction of models (typically in UML) and supporting further
metadata can help guide the component construction process.
 At a minimum, such models help in documenting an effort.
 In practically relevant cases
such as components representing relatively straightforward business
concepts in the presence of evolved application servers
components can actually be generated from their models with little further
input from developers.
Where this approach succeeds, modeling and generator tools can take the
marketing position of RAD tools.

Component testing tools


Testing of components is possibly the single most demanding aspect of
component technology.
By definition, components can only be tested in a few, hopefully representative,
configurations.Systematic approaches to testing of components are needed, and
intense tool support for this purpose is likely to be required.
Faced with the extreme difficulties of component testing, two strategies seem
advisable.The first strategy is to avoid errors statically wherever possible.The
second strategy is to make sure that components are deployed in such away that
faults leave logged traces.In this way, a failure in a production component system
can at least be traced.

Component assembly toolsComponents are assembled by instantiating and


connecting component instance sand customizing component resources.While
component instances at runtime may or may not correspond to visual entities, it is
useful to assume that all component instances have a visual representation at
assembly-time.
 It is then possible to use powerful document-centric builder tools to assemble
components, even if the runtime environment is a server or batch one.
JavaBeans is a component standard that explicitly distinguishes between assembly
time and runtime and that allows component instances to look and behave differently
during assembly-time and runtime.

36. Explain about testing tools in CDE


As the central building blocks of SOA-based applications, server-side software
components such as Web services are key to application quality. Silk Performer Æ
SOA Edition from Borland provides software component and unit testing
capabilities for optimizing the three major quality aspects of critical SOA
components early in the application lifecycle - even before client applications are
available:
• Functionality
• Performance
• Interoperability
Unlike regular unit testing tools, Silk Performer SOA Edition tests Web services,
EJBs, and .NET server components under realistic server conditions by exposing
them to concurrent user access.
Its visual scripting technology and script import wizards are quick and easy to use.
As a result, even non-programmers can detect potential problems that occur only
under real-world conditions resolve issues early in development before they become
costly realities and release high quality applications on time.
Features
Powerful, easy-to-use tool tests the functionality, performance and interoperability
of remote components under concurrent access ï Visual scripting technology enables
non-programmers to create and execute tests; alternatively developers can build tests
using Java or .NET programming languages Java/.NET Explorer and JUnit/NUnit
test importer simplify early load testing of remote application components (such as
Web services, EJBs, .NET, COM server components)
Advanced wizards provide a simple point-and-click approach to accessing
components and customizing test parameters with random values
Visual interface allows debugging during scripting to accelerate test generation
Point-and-click support for complex method parameters makes it easy to test even
the most sophisticated transactions ï Model-driven approach to test case definition
makes it easy to build meaningful test cases
Embedded Java and .NET frameworks let you reuse JUnit or NUnit test cases from
development to streamline concurrency testing ï Dual approach to testing delineates
QA and development tasks and defines interfaces for each, simplifying cross-
department communication
Open plug-in framework for 3rd party code-level diagnostics tools to provide top-
down analysis of errors and performance problems starting from the end user view
down to the individual component/line of the application code
37.Explain about assembly tools in CDE
Assembly tools

After creating the component logic and writing the business logic, we can use the
component from a simple client program. A big advantage of the CORBA
component model is the ability to connect components together to form larger
structures called component assemblies.

A component assembly is a set of components (with their component descriptors)


and a Component Assembly Descriptor (CAD).

Based on the CAD we can generate an assembly object that instantiates components
and connects them together to form a component assembly.

Assembly Descriptor Generator

The component descriptor files are the base for the higher-level assembly descriptor,
which describes the components of the assembly and their connections. That means
that all information of the assembly descriptor comes from the component
descriptors of the related components (and some additional data from a GUI).

Assembly Object Generator

At runtime a managing object is needed that can establish an assembly instance. The
assembly object creates the component instances and connects their receptacles and
facets. All information for generating an assembly object comes from the assembly
descriptor (or its DOM model in memory). Note that this object must eventually be
able to create local or local/remote assembly instances.

UML Parser

As with components, there should be a way to define component assemblies in a


UML diagram. Therefore we need a UML parser that reads the UML-XMI file and
translates the data into the DOM model used by the assembly descriptor. The OMG
has not yet defined a mapping between UML and CCM assemblies.
Assembly Packaging Tool

After generating the component assembly and its descriptor file we have to package
these files into a zip file called a component assembly package. The assembly
packaging tool provides these functionalities to the assembly developer.

Assembly Deployment Tool

On the target host the component assembly package must be unzipped, and the
assembly must be deployed in the application server. The assembly deployment tool
provides these functionalities to the assembly deployer.

You might also like