Top Banner
by Mohammad Salah Uddin Supervised by Dr. Nigel Kermode An Analysis of Component-based Software Development -Maximize the reuse of existing software
97

An Analysis of Component-based Software Development -Maximize the reuse of existing software

Nov 01, 2014

Download

Education

Component- based software development is the most promising way of controlling the soaring complexity and cost of business information systems. It is also the best way to architect, design, implement, and deploy scalable systems that provide the flexibility and agility required by today’s enterprise environment (Herzum, 1999).
The main role of component-based software engineering is to address the development of systems as an assembly of parts “components”, the development of parts as reusable entities, and the maintenance and upgrading of systems by customising and replacing such parts. However, the component-based development is still a process with many problems, it is not well defined either from theoretical or practical point of view. This dissertation gives a brief overview of Component-Based Software development and starts with brief historical evolution followed by a general explanation of the method. This dissertation also describes the importance of reusable software and its architecture.
A detailed discussion of the underlying principles like components, component frameworks and component system architectures are then presented. Some real world component stand CORBA (Common Object Request Broker Architecture), CCM (CORBA component Model) and EJB (Enterprise Java Beans) are given in detail. Finally, simple file-sharing-program based on Apache's Avalon framework is developed as a case study.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An Analysis of Component-based Software Development -Maximize the reuse of existing software

by

Mohammad Salah Uddin

Supervised by

Dr Nigel Kermode

An Analysis of Component-based Software Development

-Maximize the reuse of existing software

IN PARTIAL FULFILMENT OF THE REQUIREMENT FOR THE AWARD OF MASTERS OF SCIENCE (MSC) DEGREE IN INFORMATION TECHNOLOGY

Acknowledgements

I would like to express my gratitude to my dissertation supervisor Dr Nigel Kermode whose expertise understanding and patience added considerably to accomplish this achievement I appreciate his vast knowledge and skills of supervising He always helped and guided me

Also I would like to thank my friends specially Devangkumar Patel Xuan Tuyen and Edgar Aguirre who have always helped and advised me during my entire dissertation

Above all I would also like to thank my family for the support they provided me through my entire life In particular I must acknowledge my father and mother without his love encouragement and financial assistance I would not have finished this Dissertation

Mohammad Salah Uddin0857146 Page 2

Abstract

Component- based software development is the most promising way of controlling the soaring complexity and cost of business information systems It is also the best way to architect design implement and deploy scalable systems that provide the flexibility and agility required by todayrsquos enterprise environment (Herzum 1999)

The main role of component-based software engineering is to address the development of systems as an assembly of parts ldquocomponentsrdquo the development of parts as reusable entities and the maintenance and upgrading of systems by customising and replacing such parts However the component-based development is still a process with many problems it is not well defined either from theoretical or practical point of view This dissertation gives a brief overview of Component-Based Software development and starts with brief historical evolution followed by a general explanation of the method This dissertation also describes the importance of reusable software and its architecture

A detailed discussion of the underlying principles like components component frameworks and component system architectures are then presented Some real world component stand CORBA (Common Object Request Broker Architecture) CCM (CORBA component Model) and EJB (Enterprise Java Beans) are given in detail Finally simple file-sharing-program based on Apaches Avalon framework is developed as a case study

Mohammad Salah Uddin0857146 Page 3

Contents

Abstract3

1 Introduction6

11 Aims and Objectives8

12 Initial Review9

13 Method of Approach10

2 Component11

21 Component definition11

22 Component Characteristics12

23 Relation between Component and Object13

24 Difference between Component and Object14

25 Differences between CBSE and Traditional SE15

26 The most significant benefits of using CBSE16

27 Importance of Reusability16

271 Why is reuse important16

272 Is reuse really going to happen this time around18

273 How do we measure reuse19

28 Compromises for reuse components19

29 Component Technologies21

29 Component Modelling Languages21

3 Component Frameworks22

31 Component Framework Definition22

311 Java 2 Platform Enterprise Edition (J2EE)22

312 Microsoft NET23

32 NET Framework24

321 Common Language Infrastructure25

322 Common Language Runtime26

33 Enterprise JavaBeans the Sun way27

331 EJB Component Types29

34 CORBA Architecture31

341 CORBA Component Model32

242 Component Object Model (COM) and Distributed COM (DCOM)32

Mohammad Salah Uddin0857146 Page 4

343 CCM components33

344 Component Implementation Definition Language (CIDL)34

4 Case Study Based on Avalon Framework35

41 Introduction of Avalon Framework35

42 Problem Statement35

43 Phases of Component development36

45 System requirements36

46 Design the component37

461 Design Tools37

462 Component design37

463 Design Documentation37

47 Component Development38

471 Develop the component38

48 Tests and Result40

481 Testing Types40

5 Discussion and Evaluation42

51 Architecturesrsquo Comparison42

53 Similarities43

54 Assessment of the major component technologies44

52 Case Study Assessment47

521 Assessment of Avalon Framework47

53 Assessment of the Approach49

531 Component Security49

532 Language Independence50

54 Component designing methods for Reuse51

55 Component Search52

6 Conclusion54

Analysis of component-based software engineering54

Maximize the reuse of existing software54

7 Achievements56

References57

Appendix A61

Mohammad Salah Uddin0857146 Page 5

1 Introduction

The world of software development has evolved quickly in the last decade Over the decades software has entered all domains that make up the necessary functions of our civilization Virtually all domains have incorporated Software to achieve better functionality that could not be achieved earlier Some examples are telecommunication electricity generation and distribution logistic systems modern cars and airplanes Software is becoming more and more an integrated part of the society For instance software has allowed new organizational forms such as business process reengineering and virtual organizations which allow organizations to operate at efficiency levels that are an order of magnitude better than earlier models In addition all kinds of devices which increase efficiency would not be available without software -for example current mobile phones

Nowadays organizations are realizing the need for explicit software architecture for their systems And software engineers are faced with the challenge of developing multiple inter-related systems from the scratch while pressured by financial and time constraints It is therefore essential to establish a well-defined design method in order to build high-quality reliable and easily maintainable component or families of systems -the question is now how to approach this

The last decade has shown that object-oriented technology is not enough to cope with the rapidly changing requirements of present-day applications One of the reasons is that although object-oriented methods develop rich models that reflect the objects of the problem domain this does not necessarily yield software architectures that can be easily adapted to changing requirements In particular object-oriented methods do not lead to designs that make a clear separation between computational and compositional aspects this separation is common in component-based systems

On the other hand Component-based systems achieve flexibility by clearly separating the stable parts of the system (ie the components) from the specification of their composition Components are black box entities that encapsulate services behind well-defined interfaces These interfaces tend to be very restricted in nature reflecting a particular model of plug-compatibility supported by a component-framework rather than being very rich and reflecting real-world entities of the application domain

Mohammad Salah Uddin0857146 Page 6

Building new solutions by combining existing and made components improves and supports rapid development leading to a shorter time to market At the same time quick edition to changing requirements can be achieved by only in key changes of a component-based solution rather than undertaking a major release change Thatrsquos why civil engineers have established standardized time-tested engineering principles to building bridges using reusable parts component-based software engineers must define and describe processes to assure timely completion of high quality complex software systems that are composed of a variety of pre-built software components

(Heineman 2001)

Bringing the levels of reuse of software up to that of other engineering disciplines has long been sought but not yet achieved In the last few years however new development paradigms have emerged which promise to radically change this situation and allow software engineering to claim its rightful place in the family of engineering disciplines that is the component-based software

Mohammad Salah Uddin0857146 Page 7

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 2: An Analysis of Component-based Software Development -Maximize the reuse of existing software

IN PARTIAL FULFILMENT OF THE REQUIREMENT FOR THE AWARD OF MASTERS OF SCIENCE (MSC) DEGREE IN INFORMATION TECHNOLOGY

Acknowledgements

I would like to express my gratitude to my dissertation supervisor Dr Nigel Kermode whose expertise understanding and patience added considerably to accomplish this achievement I appreciate his vast knowledge and skills of supervising He always helped and guided me

Also I would like to thank my friends specially Devangkumar Patel Xuan Tuyen and Edgar Aguirre who have always helped and advised me during my entire dissertation

Above all I would also like to thank my family for the support they provided me through my entire life In particular I must acknowledge my father and mother without his love encouragement and financial assistance I would not have finished this Dissertation

Mohammad Salah Uddin0857146 Page 2

Abstract

Component- based software development is the most promising way of controlling the soaring complexity and cost of business information systems It is also the best way to architect design implement and deploy scalable systems that provide the flexibility and agility required by todayrsquos enterprise environment (Herzum 1999)

The main role of component-based software engineering is to address the development of systems as an assembly of parts ldquocomponentsrdquo the development of parts as reusable entities and the maintenance and upgrading of systems by customising and replacing such parts However the component-based development is still a process with many problems it is not well defined either from theoretical or practical point of view This dissertation gives a brief overview of Component-Based Software development and starts with brief historical evolution followed by a general explanation of the method This dissertation also describes the importance of reusable software and its architecture

A detailed discussion of the underlying principles like components component frameworks and component system architectures are then presented Some real world component stand CORBA (Common Object Request Broker Architecture) CCM (CORBA component Model) and EJB (Enterprise Java Beans) are given in detail Finally simple file-sharing-program based on Apaches Avalon framework is developed as a case study

Mohammad Salah Uddin0857146 Page 3

Contents

Abstract3

1 Introduction6

11 Aims and Objectives8

12 Initial Review9

13 Method of Approach10

2 Component11

21 Component definition11

22 Component Characteristics12

23 Relation between Component and Object13

24 Difference between Component and Object14

25 Differences between CBSE and Traditional SE15

26 The most significant benefits of using CBSE16

27 Importance of Reusability16

271 Why is reuse important16

272 Is reuse really going to happen this time around18

273 How do we measure reuse19

28 Compromises for reuse components19

29 Component Technologies21

29 Component Modelling Languages21

3 Component Frameworks22

31 Component Framework Definition22

311 Java 2 Platform Enterprise Edition (J2EE)22

312 Microsoft NET23

32 NET Framework24

321 Common Language Infrastructure25

322 Common Language Runtime26

33 Enterprise JavaBeans the Sun way27

331 EJB Component Types29

34 CORBA Architecture31

341 CORBA Component Model32

242 Component Object Model (COM) and Distributed COM (DCOM)32

Mohammad Salah Uddin0857146 Page 4

343 CCM components33

344 Component Implementation Definition Language (CIDL)34

4 Case Study Based on Avalon Framework35

41 Introduction of Avalon Framework35

42 Problem Statement35

43 Phases of Component development36

45 System requirements36

46 Design the component37

461 Design Tools37

462 Component design37

463 Design Documentation37

47 Component Development38

471 Develop the component38

48 Tests and Result40

481 Testing Types40

5 Discussion and Evaluation42

51 Architecturesrsquo Comparison42

53 Similarities43

54 Assessment of the major component technologies44

52 Case Study Assessment47

521 Assessment of Avalon Framework47

53 Assessment of the Approach49

531 Component Security49

532 Language Independence50

54 Component designing methods for Reuse51

55 Component Search52

6 Conclusion54

Analysis of component-based software engineering54

Maximize the reuse of existing software54

7 Achievements56

References57

Appendix A61

Mohammad Salah Uddin0857146 Page 5

1 Introduction

The world of software development has evolved quickly in the last decade Over the decades software has entered all domains that make up the necessary functions of our civilization Virtually all domains have incorporated Software to achieve better functionality that could not be achieved earlier Some examples are telecommunication electricity generation and distribution logistic systems modern cars and airplanes Software is becoming more and more an integrated part of the society For instance software has allowed new organizational forms such as business process reengineering and virtual organizations which allow organizations to operate at efficiency levels that are an order of magnitude better than earlier models In addition all kinds of devices which increase efficiency would not be available without software -for example current mobile phones

Nowadays organizations are realizing the need for explicit software architecture for their systems And software engineers are faced with the challenge of developing multiple inter-related systems from the scratch while pressured by financial and time constraints It is therefore essential to establish a well-defined design method in order to build high-quality reliable and easily maintainable component or families of systems -the question is now how to approach this

The last decade has shown that object-oriented technology is not enough to cope with the rapidly changing requirements of present-day applications One of the reasons is that although object-oriented methods develop rich models that reflect the objects of the problem domain this does not necessarily yield software architectures that can be easily adapted to changing requirements In particular object-oriented methods do not lead to designs that make a clear separation between computational and compositional aspects this separation is common in component-based systems

On the other hand Component-based systems achieve flexibility by clearly separating the stable parts of the system (ie the components) from the specification of their composition Components are black box entities that encapsulate services behind well-defined interfaces These interfaces tend to be very restricted in nature reflecting a particular model of plug-compatibility supported by a component-framework rather than being very rich and reflecting real-world entities of the application domain

Mohammad Salah Uddin0857146 Page 6

Building new solutions by combining existing and made components improves and supports rapid development leading to a shorter time to market At the same time quick edition to changing requirements can be achieved by only in key changes of a component-based solution rather than undertaking a major release change Thatrsquos why civil engineers have established standardized time-tested engineering principles to building bridges using reusable parts component-based software engineers must define and describe processes to assure timely completion of high quality complex software systems that are composed of a variety of pre-built software components

(Heineman 2001)

Bringing the levels of reuse of software up to that of other engineering disciplines has long been sought but not yet achieved In the last few years however new development paradigms have emerged which promise to radically change this situation and allow software engineering to claim its rightful place in the family of engineering disciplines that is the component-based software

Mohammad Salah Uddin0857146 Page 7

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 3: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Abstract

Component- based software development is the most promising way of controlling the soaring complexity and cost of business information systems It is also the best way to architect design implement and deploy scalable systems that provide the flexibility and agility required by todayrsquos enterprise environment (Herzum 1999)

The main role of component-based software engineering is to address the development of systems as an assembly of parts ldquocomponentsrdquo the development of parts as reusable entities and the maintenance and upgrading of systems by customising and replacing such parts However the component-based development is still a process with many problems it is not well defined either from theoretical or practical point of view This dissertation gives a brief overview of Component-Based Software development and starts with brief historical evolution followed by a general explanation of the method This dissertation also describes the importance of reusable software and its architecture

A detailed discussion of the underlying principles like components component frameworks and component system architectures are then presented Some real world component stand CORBA (Common Object Request Broker Architecture) CCM (CORBA component Model) and EJB (Enterprise Java Beans) are given in detail Finally simple file-sharing-program based on Apaches Avalon framework is developed as a case study

Mohammad Salah Uddin0857146 Page 3

Contents

Abstract3

1 Introduction6

11 Aims and Objectives8

12 Initial Review9

13 Method of Approach10

2 Component11

21 Component definition11

22 Component Characteristics12

23 Relation between Component and Object13

24 Difference between Component and Object14

25 Differences between CBSE and Traditional SE15

26 The most significant benefits of using CBSE16

27 Importance of Reusability16

271 Why is reuse important16

272 Is reuse really going to happen this time around18

273 How do we measure reuse19

28 Compromises for reuse components19

29 Component Technologies21

29 Component Modelling Languages21

3 Component Frameworks22

31 Component Framework Definition22

311 Java 2 Platform Enterprise Edition (J2EE)22

312 Microsoft NET23

32 NET Framework24

321 Common Language Infrastructure25

322 Common Language Runtime26

33 Enterprise JavaBeans the Sun way27

331 EJB Component Types29

34 CORBA Architecture31

341 CORBA Component Model32

242 Component Object Model (COM) and Distributed COM (DCOM)32

Mohammad Salah Uddin0857146 Page 4

343 CCM components33

344 Component Implementation Definition Language (CIDL)34

4 Case Study Based on Avalon Framework35

41 Introduction of Avalon Framework35

42 Problem Statement35

43 Phases of Component development36

45 System requirements36

46 Design the component37

461 Design Tools37

462 Component design37

463 Design Documentation37

47 Component Development38

471 Develop the component38

48 Tests and Result40

481 Testing Types40

5 Discussion and Evaluation42

51 Architecturesrsquo Comparison42

53 Similarities43

54 Assessment of the major component technologies44

52 Case Study Assessment47

521 Assessment of Avalon Framework47

53 Assessment of the Approach49

531 Component Security49

532 Language Independence50

54 Component designing methods for Reuse51

55 Component Search52

6 Conclusion54

Analysis of component-based software engineering54

Maximize the reuse of existing software54

7 Achievements56

References57

Appendix A61

Mohammad Salah Uddin0857146 Page 5

1 Introduction

The world of software development has evolved quickly in the last decade Over the decades software has entered all domains that make up the necessary functions of our civilization Virtually all domains have incorporated Software to achieve better functionality that could not be achieved earlier Some examples are telecommunication electricity generation and distribution logistic systems modern cars and airplanes Software is becoming more and more an integrated part of the society For instance software has allowed new organizational forms such as business process reengineering and virtual organizations which allow organizations to operate at efficiency levels that are an order of magnitude better than earlier models In addition all kinds of devices which increase efficiency would not be available without software -for example current mobile phones

Nowadays organizations are realizing the need for explicit software architecture for their systems And software engineers are faced with the challenge of developing multiple inter-related systems from the scratch while pressured by financial and time constraints It is therefore essential to establish a well-defined design method in order to build high-quality reliable and easily maintainable component or families of systems -the question is now how to approach this

The last decade has shown that object-oriented technology is not enough to cope with the rapidly changing requirements of present-day applications One of the reasons is that although object-oriented methods develop rich models that reflect the objects of the problem domain this does not necessarily yield software architectures that can be easily adapted to changing requirements In particular object-oriented methods do not lead to designs that make a clear separation between computational and compositional aspects this separation is common in component-based systems

On the other hand Component-based systems achieve flexibility by clearly separating the stable parts of the system (ie the components) from the specification of their composition Components are black box entities that encapsulate services behind well-defined interfaces These interfaces tend to be very restricted in nature reflecting a particular model of plug-compatibility supported by a component-framework rather than being very rich and reflecting real-world entities of the application domain

Mohammad Salah Uddin0857146 Page 6

Building new solutions by combining existing and made components improves and supports rapid development leading to a shorter time to market At the same time quick edition to changing requirements can be achieved by only in key changes of a component-based solution rather than undertaking a major release change Thatrsquos why civil engineers have established standardized time-tested engineering principles to building bridges using reusable parts component-based software engineers must define and describe processes to assure timely completion of high quality complex software systems that are composed of a variety of pre-built software components

(Heineman 2001)

Bringing the levels of reuse of software up to that of other engineering disciplines has long been sought but not yet achieved In the last few years however new development paradigms have emerged which promise to radically change this situation and allow software engineering to claim its rightful place in the family of engineering disciplines that is the component-based software

Mohammad Salah Uddin0857146 Page 7

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 4: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Contents

Abstract3

1 Introduction6

11 Aims and Objectives8

12 Initial Review9

13 Method of Approach10

2 Component11

21 Component definition11

22 Component Characteristics12

23 Relation between Component and Object13

24 Difference between Component and Object14

25 Differences between CBSE and Traditional SE15

26 The most significant benefits of using CBSE16

27 Importance of Reusability16

271 Why is reuse important16

272 Is reuse really going to happen this time around18

273 How do we measure reuse19

28 Compromises for reuse components19

29 Component Technologies21

29 Component Modelling Languages21

3 Component Frameworks22

31 Component Framework Definition22

311 Java 2 Platform Enterprise Edition (J2EE)22

312 Microsoft NET23

32 NET Framework24

321 Common Language Infrastructure25

322 Common Language Runtime26

33 Enterprise JavaBeans the Sun way27

331 EJB Component Types29

34 CORBA Architecture31

341 CORBA Component Model32

242 Component Object Model (COM) and Distributed COM (DCOM)32

Mohammad Salah Uddin0857146 Page 4

343 CCM components33

344 Component Implementation Definition Language (CIDL)34

4 Case Study Based on Avalon Framework35

41 Introduction of Avalon Framework35

42 Problem Statement35

43 Phases of Component development36

45 System requirements36

46 Design the component37

461 Design Tools37

462 Component design37

463 Design Documentation37

47 Component Development38

471 Develop the component38

48 Tests and Result40

481 Testing Types40

5 Discussion and Evaluation42

51 Architecturesrsquo Comparison42

53 Similarities43

54 Assessment of the major component technologies44

52 Case Study Assessment47

521 Assessment of Avalon Framework47

53 Assessment of the Approach49

531 Component Security49

532 Language Independence50

54 Component designing methods for Reuse51

55 Component Search52

6 Conclusion54

Analysis of component-based software engineering54

Maximize the reuse of existing software54

7 Achievements56

References57

Appendix A61

Mohammad Salah Uddin0857146 Page 5

1 Introduction

The world of software development has evolved quickly in the last decade Over the decades software has entered all domains that make up the necessary functions of our civilization Virtually all domains have incorporated Software to achieve better functionality that could not be achieved earlier Some examples are telecommunication electricity generation and distribution logistic systems modern cars and airplanes Software is becoming more and more an integrated part of the society For instance software has allowed new organizational forms such as business process reengineering and virtual organizations which allow organizations to operate at efficiency levels that are an order of magnitude better than earlier models In addition all kinds of devices which increase efficiency would not be available without software -for example current mobile phones

Nowadays organizations are realizing the need for explicit software architecture for their systems And software engineers are faced with the challenge of developing multiple inter-related systems from the scratch while pressured by financial and time constraints It is therefore essential to establish a well-defined design method in order to build high-quality reliable and easily maintainable component or families of systems -the question is now how to approach this

The last decade has shown that object-oriented technology is not enough to cope with the rapidly changing requirements of present-day applications One of the reasons is that although object-oriented methods develop rich models that reflect the objects of the problem domain this does not necessarily yield software architectures that can be easily adapted to changing requirements In particular object-oriented methods do not lead to designs that make a clear separation between computational and compositional aspects this separation is common in component-based systems

On the other hand Component-based systems achieve flexibility by clearly separating the stable parts of the system (ie the components) from the specification of their composition Components are black box entities that encapsulate services behind well-defined interfaces These interfaces tend to be very restricted in nature reflecting a particular model of plug-compatibility supported by a component-framework rather than being very rich and reflecting real-world entities of the application domain

Mohammad Salah Uddin0857146 Page 6

Building new solutions by combining existing and made components improves and supports rapid development leading to a shorter time to market At the same time quick edition to changing requirements can be achieved by only in key changes of a component-based solution rather than undertaking a major release change Thatrsquos why civil engineers have established standardized time-tested engineering principles to building bridges using reusable parts component-based software engineers must define and describe processes to assure timely completion of high quality complex software systems that are composed of a variety of pre-built software components

(Heineman 2001)

Bringing the levels of reuse of software up to that of other engineering disciplines has long been sought but not yet achieved In the last few years however new development paradigms have emerged which promise to radically change this situation and allow software engineering to claim its rightful place in the family of engineering disciplines that is the component-based software

Mohammad Salah Uddin0857146 Page 7

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 5: An Analysis of Component-based Software Development -Maximize the reuse of existing software

343 CCM components33

344 Component Implementation Definition Language (CIDL)34

4 Case Study Based on Avalon Framework35

41 Introduction of Avalon Framework35

42 Problem Statement35

43 Phases of Component development36

45 System requirements36

46 Design the component37

461 Design Tools37

462 Component design37

463 Design Documentation37

47 Component Development38

471 Develop the component38

48 Tests and Result40

481 Testing Types40

5 Discussion and Evaluation42

51 Architecturesrsquo Comparison42

53 Similarities43

54 Assessment of the major component technologies44

52 Case Study Assessment47

521 Assessment of Avalon Framework47

53 Assessment of the Approach49

531 Component Security49

532 Language Independence50

54 Component designing methods for Reuse51

55 Component Search52

6 Conclusion54

Analysis of component-based software engineering54

Maximize the reuse of existing software54

7 Achievements56

References57

Appendix A61

Mohammad Salah Uddin0857146 Page 5

1 Introduction

The world of software development has evolved quickly in the last decade Over the decades software has entered all domains that make up the necessary functions of our civilization Virtually all domains have incorporated Software to achieve better functionality that could not be achieved earlier Some examples are telecommunication electricity generation and distribution logistic systems modern cars and airplanes Software is becoming more and more an integrated part of the society For instance software has allowed new organizational forms such as business process reengineering and virtual organizations which allow organizations to operate at efficiency levels that are an order of magnitude better than earlier models In addition all kinds of devices which increase efficiency would not be available without software -for example current mobile phones

Nowadays organizations are realizing the need for explicit software architecture for their systems And software engineers are faced with the challenge of developing multiple inter-related systems from the scratch while pressured by financial and time constraints It is therefore essential to establish a well-defined design method in order to build high-quality reliable and easily maintainable component or families of systems -the question is now how to approach this

The last decade has shown that object-oriented technology is not enough to cope with the rapidly changing requirements of present-day applications One of the reasons is that although object-oriented methods develop rich models that reflect the objects of the problem domain this does not necessarily yield software architectures that can be easily adapted to changing requirements In particular object-oriented methods do not lead to designs that make a clear separation between computational and compositional aspects this separation is common in component-based systems

On the other hand Component-based systems achieve flexibility by clearly separating the stable parts of the system (ie the components) from the specification of their composition Components are black box entities that encapsulate services behind well-defined interfaces These interfaces tend to be very restricted in nature reflecting a particular model of plug-compatibility supported by a component-framework rather than being very rich and reflecting real-world entities of the application domain

Mohammad Salah Uddin0857146 Page 6

Building new solutions by combining existing and made components improves and supports rapid development leading to a shorter time to market At the same time quick edition to changing requirements can be achieved by only in key changes of a component-based solution rather than undertaking a major release change Thatrsquos why civil engineers have established standardized time-tested engineering principles to building bridges using reusable parts component-based software engineers must define and describe processes to assure timely completion of high quality complex software systems that are composed of a variety of pre-built software components

(Heineman 2001)

Bringing the levels of reuse of software up to that of other engineering disciplines has long been sought but not yet achieved In the last few years however new development paradigms have emerged which promise to radically change this situation and allow software engineering to claim its rightful place in the family of engineering disciplines that is the component-based software

Mohammad Salah Uddin0857146 Page 7

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 6: An Analysis of Component-based Software Development -Maximize the reuse of existing software

1 Introduction

The world of software development has evolved quickly in the last decade Over the decades software has entered all domains that make up the necessary functions of our civilization Virtually all domains have incorporated Software to achieve better functionality that could not be achieved earlier Some examples are telecommunication electricity generation and distribution logistic systems modern cars and airplanes Software is becoming more and more an integrated part of the society For instance software has allowed new organizational forms such as business process reengineering and virtual organizations which allow organizations to operate at efficiency levels that are an order of magnitude better than earlier models In addition all kinds of devices which increase efficiency would not be available without software -for example current mobile phones

Nowadays organizations are realizing the need for explicit software architecture for their systems And software engineers are faced with the challenge of developing multiple inter-related systems from the scratch while pressured by financial and time constraints It is therefore essential to establish a well-defined design method in order to build high-quality reliable and easily maintainable component or families of systems -the question is now how to approach this

The last decade has shown that object-oriented technology is not enough to cope with the rapidly changing requirements of present-day applications One of the reasons is that although object-oriented methods develop rich models that reflect the objects of the problem domain this does not necessarily yield software architectures that can be easily adapted to changing requirements In particular object-oriented methods do not lead to designs that make a clear separation between computational and compositional aspects this separation is common in component-based systems

On the other hand Component-based systems achieve flexibility by clearly separating the stable parts of the system (ie the components) from the specification of their composition Components are black box entities that encapsulate services behind well-defined interfaces These interfaces tend to be very restricted in nature reflecting a particular model of plug-compatibility supported by a component-framework rather than being very rich and reflecting real-world entities of the application domain

Mohammad Salah Uddin0857146 Page 6

Building new solutions by combining existing and made components improves and supports rapid development leading to a shorter time to market At the same time quick edition to changing requirements can be achieved by only in key changes of a component-based solution rather than undertaking a major release change Thatrsquos why civil engineers have established standardized time-tested engineering principles to building bridges using reusable parts component-based software engineers must define and describe processes to assure timely completion of high quality complex software systems that are composed of a variety of pre-built software components

(Heineman 2001)

Bringing the levels of reuse of software up to that of other engineering disciplines has long been sought but not yet achieved In the last few years however new development paradigms have emerged which promise to radically change this situation and allow software engineering to claim its rightful place in the family of engineering disciplines that is the component-based software

Mohammad Salah Uddin0857146 Page 7

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 7: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Building new solutions by combining existing and made components improves and supports rapid development leading to a shorter time to market At the same time quick edition to changing requirements can be achieved by only in key changes of a component-based solution rather than undertaking a major release change Thatrsquos why civil engineers have established standardized time-tested engineering principles to building bridges using reusable parts component-based software engineers must define and describe processes to assure timely completion of high quality complex software systems that are composed of a variety of pre-built software components

(Heineman 2001)

Bringing the levels of reuse of software up to that of other engineering disciplines has long been sought but not yet achieved In the last few years however new development paradigms have emerged which promise to radically change this situation and allow software engineering to claim its rightful place in the family of engineering disciplines that is the component-based software

Mohammad Salah Uddin0857146 Page 7

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 8: An Analysis of Component-based Software Development -Maximize the reuse of existing software

11 Aims and Objectives

In this section the aims of the research are identified The primary objectives of the research are to study the current state of component technology How to use them in the design implementation and maintenance of software systems How to maximize the reuse of existing software In detail the following objectives were set

What are the most significant benefits of using CBSE What are the principal activities in the CBSE process Why one may have to make requirements compromises so that components can be

reused What component technologies are available from component vendors What are the main criteria when designing components intended for reuse How to identify components needed for particular purpose (component search)

Mohammad Salah Uddin0857146 Page 8

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 9: An Analysis of Component-based Software Development -Maximize the reuse of existing software

12 Initial Review

Component-based software development (CBSD) has its roots originating in the late sixties Software development back then was and still remains today a very young discipline contrasting its counter parts such as civil mechanical and electrical engineering As demand for software increased such as usability robustness reliability flexibility and adaptability major problems in software development were ran into Bad software quality very low productivity and cost explosion

As a result In 1968 NATO called a conference for constant failure of system developers to deliver software systems within budget on time and of satisfactory quality for use In that conference NATO deal with the so-called ldquoSoftware Crisisrdquo A report written by Doug McIllroy in 1969 on ldquomass-produced software componentsrdquo first introduced the idea of ldquosoftware componentrdquo He proposed a software industry that supplied off-the-shelf standard software components He predicted that developers would build software solutions from existing software components instead of building them from scratch

Brad Cox introduced the idea of ldquosoftware integrated circuitrdquo which are pieces of software that can be ldquopluggedrdquo or ldquounpluggedrdquo from a system and are as well replaceable and reconfigurable Just like an electrical integrated circuit or a computer hardware component the software equivalent will provide a fixed function and an interface specification without informative any of its internal implementation Cox also mentioned the fact that these circuits or components can be sold on the open market

(Cox 1986)

Nowadays many people argue that cost minimization is one of the main factors for designing software For that reason reuse-based software engineering is becoming the important development approach for business and commercial systems CBSE emerged in the late 1990s as a reuse-based approach to software systems development Its creation was motivated by designer frustration that object-oriented had not led to extensive reuse as originally suggested Single object-oriented were too detailed and specific and often had to be bound with an application at compile-time This made marketing object as reusable components difficult In spite of early optimistic prediction no significant market for individual objects has ever developed

Mohammad Salah Uddin0857146 Page 9

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 10: An Analysis of Component-based Software Development -Maximize the reuse of existing software

CBSE is the process of defining implementing and integrating or composing loosely coupled independent into system It has becomes as an important software development approach because software systems are becoming larger and more complex and customers are demanding more dependable software that is developed more quickly and less expensive

13 Method of Approach

This primary part of the research will be conducted based on a case study on the Avalon Framework The main focus from these case studies will be as bout following parts-

Problem Statement Design Decisions Server Component Development Tests and Result Implementation

After implemented the component an assessment and analysis has been presented for successful the primary part of the research

This Secondary part of the research has been conducted based on journals published books and articles and the internet

Mohammad Salah Uddin0857146 Page 10

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 11: An Analysis of Component-based Software Development -Maximize the reuse of existing software

2 Component

This chapter considers about the componentrsquos definition characteristics difference between Components and object differences between CBSE and Traditional SE significant benefits of CBSE importance of reusability compromises for reusability and finally shows some importance component technologies and different component modelling languages

21 Component definition

A component is an independent software unit that can be composed with other components to create a software system However different people have definitions of a software component In 2001 Council and Heineman define a component as

A software element that conforms to a component model and can be independently deployed and composed without modification accordingly to a composition standard

This definition essentially based on standard-a software unit that conform to these standards is a component (Szyperski 2002)

However in this definition it does not mention standards of a component but focuses instead on the key characteristics of components

A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only A software component can be deployed independently and is subject to composition by third parties

Szyperski also states that a component has no externally observable This means that copies are impossible to differentiate However some component models such as Enterprise Java Beans model allow stateful components So these clearly do not correspond with Szyperskirsquos definition of a component While stateless component are certainly simpler to use but Somerville think that CBSE should accommodate both stateless and stateful components

Mohammad Salah Uddin0857146 Page 11

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 12: An Analysis of Component-based Software Development -Maximize the reuse of existing software

22 Component Characteristics

Standardised Component standardisation means that a component used in a CBSE process has to conform to some standardised component model This model may define component interfaces component metadata documentation composition and deployment

Independent A component should be independent- it should be possible to compose and deploy it without having to use other specific components In situations where the component needs externally provided services these should be explicitly set out in a lsquorequiresrsquo interface specification

Composable Component have to be composable it means that all external interactions must take place through publicly defined interfaces Also it should provide external access to information about itself such as its methods and attributes

Deployable A component has to be self-contained and must be able to operate as a stand-alone entity on some component platform that implements the component model This means that the component is a binary component that does not have to be compiled before it is deployed

Documented Components have to be fully documented so that potential users of the component can decide whether or not they meet their needs The syntax and ideally the semantics of all component interfaces have to be specified

These formal component definitions are rather abstract These definitions not really give us a clear Picture of what a component does One of the most useful ways to consider a component is as a standalone service provider When a system needs some service it calls on a component to provide that service without caring about that component is executing or the programming language used to develop the component

Viewing a component as service provider emphasises two critical characteristics of a reusable component are shown below-

1 The component is an independent executable entity Before using the component with other component it does need to compile because source code is no available for component

Mohammad Salah Uddin0857146 Page 12

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 13: An Analysis of Component-based Software Development -Maximize the reuse of existing software

2 All interaction of component does through interface because Components are made through an interface The component interface is expressed in terms of parameterised operations and its internal state is never exposed

Most general case components thought of as having two related interfaces

Provides interface

Defines the component services to other components

Requires interface

Defines the services that specifies what services must be made available for the component to execute as specified

23 Relation between Component and Object

There is a strong relation between object-oriented programming 1048576OOP_ and components Component models also called component standards COM _DCOM NET Enterprise Java Beans 1048576EJB and CORBA Component Model (CCM) relate Component Interface to Class Interface Components adopt object principles of unification of functions and data encapsulation Cheessman and Daniels consider that a component can exist in several forms during its lifecycle

Component Specification component characteristics component function_

Component Interface a part of its specification a definition of a componentrsquos behaviour

Component Implementation A realisation of a Component Specification Installed Component deployed instance of a Component Implementation Component Object an instance of Installed Object

Mohammad Salah Uddin0857146 Page 13

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 14: An Analysis of Component-based Software Development -Maximize the reuse of existing software

24 Difference between Component and Object

Component

Component does not define types Component implementations are difficult Component is stateless and is a unit of deployment Components are language-independent Components are standardized Component is as parts of a system which can be reused but are not necessarily well

defined with explicit interfaces A component can be an amorphous part of a system the adaptation of which may

require much effort Such components (or rather reusable entities) are of extreme importance as the larger the components the greater the productivity which can be achieved by their reuse

Component standards are mostly concentrated on the interface definition while non-functional properties are specified (if specified at all) informally in separate documentation

Object

Instantiation identity and encapsulation lead to the properties of objects In addition the Characteristic of an object are given follows

Object has a unique identity An object may have state and which is observable state and behaviour of an object is encapsulated

Moreover There e are some properties which are directly related to object characteristics A number of object properties directly follow these characteristics Because an object is a unit of instantiation it cannot be partially instantiated Since an object has individual state it also has a unique identity that is enough to identify the object despite state changes for its entire lifetime As objects are instantiated there needs to be construction plan that describes the state space initial state and behaviour of a new object Also that plan needs to exist before the object can come into existence Such a plan may be explicitly available and is then called a class Alternatively it may be implicitly available in the form of an object that already exist that is sufficiently close to the object to be created and can be cloned Such a pre-existing object is called a prototype object

Mohammad Salah Uddin0857146 Page 14

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 15: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Component act through objects and therefore normally consist of one or more classes In addition it might contain a set of immutable objects that capture default initial state and other component resources

However there is no need for a component to contain classes only or even to contain classes at all Instead a component could contain traditional procedures and even have global (static) variables or it may be realized in its entirety using a functional programming approach or using assembly language or any other programming approach

25 Differences between CBSE and Traditional SE

CBSE views the system as a set of off-the-shelf components integrated within an appropriate architecture

SE seeks to create a system from scratch CBSE Life Cycle is shorter and less expensive

Fig 21 differences between CBSE amp tradition

SE (Crnkovic 2003)

CBSE does not have any standard development models like UML for SE CBSE is young therefore long term maintainability is largely unknown

(Wang 2000)

SE can fulfill requirements more easily

Mohammad Salah Uddin0857146 Page 15

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 16: An Analysis of Component-based Software Development -Maximize the reuse of existing software

CBSE fulfillment of requirements is based on the available components

26 The most significant benefits of using CBSE

Now a dayrsquos software systems are becoming larger and more complex In addition customers are demanding more dependable software that is developed more quickly and less expensive CBSE is trying to fulfil the customer demand

The most significant benefits of using CBSE are-

Management of Complexity Reduce Development Time Increased Productivity Improved Quality

(Crnkovic 2003)

27 Importance of Reusability

271 Why is reuse important

Reuse is important because it yields software economies of scale If software organizations wish to survive in an increasingly competitive world then they need to acknowledge the increasing economies of scale achieved by their competitors and respond appropriately to it

However nowadays reusability is the most important for industry manufacturing industry A component is a type class of objects or any other work product that has been specifically engineered to be reused CBD appears to be the best development approach mainly because of its capacity for reusability and therefore itrsquos potential for saving time and effort Consequently market for CBD tools and frameworks is rising rapidly (Lefebvre 2005)

Since reusability is the most important for industry a brief history for reusability is illustrated in following figure and its summary description is as follows (Bellur 2005)

Reusability came when programmers discovered that they spent much time to reprogram existing data-structures and class libraries Several commercial class libraries began to appear and the popularity of these libraries paid peoplersquos attention to the promise of the reuse of software These class libraries provided some set of related classes which one could use directly via composition or could specialize via inheritance to develop software Then

Mohammad Salah Uddin0857146 Page 16

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 17: An Analysis of Component-based Software Development -Maximize the reuse of existing software

frameworks were introduced providing solution to a problem via an abstract design which one then had to specialize and tune The difficulty with frameworks was that they were abstract reusable ldquodesignsrdquo which had to be embodied by expert programmers The solution was to combine the advantages of reusable designs with those of reusable implementations These are components the state-of-the-art in software world A component can be defined as reusable software artefact which is the unit of software distribution and manageability at design and runtimes

Fig 22 Reusability through development techniques (Bellur 2005)

Some business goals are provided with the help of reusability as follows (Kozak 2002)

Increase productivity After an initial investment reuse of existing assets will enable projects to decrease the cost of developing and maintaining software

Shorten time-to-market Design time is hugely reduced because key architectural decisions have been made and are embodied in the component model and framework (Bachman 2005)

Improve software quality Software that has been used multiple times will possess fewer defects than freshly coded components

Mohammad Salah Uddin0857146 Page 17

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 18: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Reduce risk It automatically reduce costs when available reusable components already include the desired functionality and have standard interfaces to facilitate integration so it has less risk compare to create new software

Provide consistency and interoperability across products Standard interfaces and common use of components across products facilitate ease of use and interoperability For example when several software products reuse the same user interface scheme terms and conventions are used consistently Reuse also contributes to interoperability For example when a component that contains an error-message handling routine is reused by several systems these systems can expect consistent behaviour

Ensure productsystem conformance with user requirements through prototyping Because the availability of reusable components facilitates prototyping user requirements may be more easily validated This prototyping will also enable detection and resolution of defects earlier in the software life cycle - avoiding more costly fixes later in the life cycle

Leverage technical skills and knowledge Reuse enables specialists to optimize software architectures and assets which may then be reused by others who are focusing on meeting product features and market needs

Improve functionality andor performance Reuse allows for the investment of time to improve functionality andor performance Because this time can be amortized over multiple uses of the assets this investment for such improvements is more economically justified than the case where they would only be for single product

272 Is reuse really going to happen this time around

CBD offers a multiple focus of reuse

External component libraries In-house component infrastructure Mining components from legacy systems

Of these it is the legacy mining that seems to offer the greatest chance of genuine economies of scale

Mohammad Salah Uddin0857146 Page 18

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 19: An Analysis of Component-based Software Development -Maximize the reuse of existing software

273 How do we measure reuse

There are at least three possible ways of defining software reuse

Static reuse can be defined in terms of the number of source code references to component or the number of software items that refer to component Static reuse generates application benefit in terms of faster development andor easier maintenance

Deployment reuse can be defined in terms of the number of consumers with access to services provided directly or indirectly by component

Dynamic reuse can be defined in terms of the frequency of execution of component

Business benefit comes from high levels of deployment reuse and dynamic reuse This can often be achieved without high levels of static reuse However a lot of software engineering is focused on static reuse

28 Compromises for reuse components

Over the years software reusability has become a research area in its own right ndash and more recently has emerged into what is now known as CBSE Itrsquos a process that aims to design and construct software systems using reusable software components Early approaches to reusability have been adhoc There hasnrsquot been any standards adopted by the industry as a whole and without standards it has been difficult for developers to be motivated to design with reusability in mind

Increasingly complex systems now need to be built with shorter amounts of time available The ldquobuy donrsquot build approachrdquo is more important and popular than ever

The business and organizational context within which applications are developed deployed and maintained has changed There is an increasing need to communicate with legacy systems as well as constantly updating current systems This need for new functionality in current applications requires technology that will allow easy additions

CBSE has changed most of the part of these situations The reason is itrsquos easy to assemble as well as cheaper to build Although this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true The software systems built using CBSE are not only simpler to assemble and cheaper but also turn out to be more robust adaptable and updateable

Mohammad Salah Uddin0857146 Page 19

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 20: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Over the past decade many people have attempted to improve design techniques and more expressive notations for a software development And also encouraging reuse of pre-developed system pieces rather than building from scratch Each approach has had some notable success in improving the quality flexibility and maintainability of application systems helping many organizations develop complex mission-critical applications deployed on a wide range of platforms

Despite this success many organization still facing lots of problems for developing and maintain a large-scale software-intensive system Mainly when it comes to test and update the system Unless carefully designed it can be very expensive (in time as well as cost) to add further functionality to a system effectively Furthermore in recent years the requirements tactics and expectations of application developers have changed significantly They are more aware of the need to write reusable code ndash even though they may not always employ this practice

All Though CBSE allows software systems to be more easily assembled and less costly to build But this cannot be guaranteed the limited experience of adopting this strategy has shown it to be true

CBSE allows use of predictable architectural patterns and standard software architecture leading to a higher quality end result Moreover the main benefit or advantage CBSE is failure of developing a reusable component is less expensive (in time as well as cost) than developing a new system So the organizations are compromising to use the CBSE for avoiding the risk

Mohammad Salah Uddin0857146 Page 20

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 21: An Analysis of Component-based Software Development -Maximize the reuse of existing software

29 Component Technologies

There are some different technologies which are used for component development Such as Microsofts Component Object Model (COM) and Suns JavaBeans which are the more popular component model These component models have recently been extended to allow for distributed execution across multiple machines in eg Microsofts COM+ NET for the Suns Enterprise Java Beans (EJB) and the OMGs CORBA Component Model (CCM) The availability of these technologies as enabled an approach to software development that is often referred to as component based development (CBD) CBD involves the construction and deployment of software systems that have been assembled from components CBD includes activities such as the discovery engineering procurement of components as well as the re-engineering of legacy software for component assembly Component deployment denotes the activities that are related to the transfer of components into a run-time environment and the configuration and customization of components without changing their implementation

(Emmerich 2002)

29 Component Modelling Languages

For all software engineering approaches both analysis and design phases are common To perform these steps successfully they need some tools and modelling utilities such as UML (Kruchten) called often with ldquoobject-orientationrdquo UML has yet been inevitable for software projects whether they are based on components or objects There are plenty of tools for UML such as PowerDesigner Rational Rose etc

There is another new modelling language which is designed only foe developing component-oriented systems it is known as COSE Modeling Language (COSEML) There is only one immature tool for COSEML It is COSECASE (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 21

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 22: An Analysis of Component-based Software Development -Maximize the reuse of existing software

3 Component Frameworks

This chapter enlightens the important concepts of component framework and detail overview of three major frameworks such NET EJB (Enterprise Java Beans) and CORBA (Common Object Request Broker Architecture) Component Framework

31 Component Framework Definition

A component framework is a set of rules and interfaces that regulate the interaction of components plugged into the framework A component framework enforces the more important rules of interaction by encapsulating the required interaction mechanisms The concept is applied sometimes hierarchically such that component frameworks are themselves components plugging into higher-tier component frameworks The key contribution of component framework is partial enforcement of architectural principles A good framework can reduce the cost of developing an application a lot because it lets you reuse both design and code

Component-based development (CBD) has received much attention in the software engineering community Using CBD large software systems can be assembled from independent reusable components Two component frameworks that support this model are the Java 2 Platform Enterprise Edition (J2EE) and Microsoft NET

311 Java 2 Platform Enterprise Edition (J2EE)

Developed by Sun Microsystems the J2EE defines a standard for developing component-based multi-tier enterprise applications J2EE provides a set of APIs (Application Program Interfaces) to implement availability security reliability and scalability into applications developed under this component framework Components are mainly developed using the Java language and deployed in containers that transparently provide services to those components such as lifecycle management transaction management access control and others

There are several technologies and APIs that are a part of J2EE

Java Server Pages (JSP) and servlets Enterprise JavaBeans (EJB) Java Messaging Service (JMS) Java Database Connectivity (JDBC)

Mohammad Salah Uddin0857146 Page 22

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 23: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Java Transaction API (JTA)

312 Microsoft NET

Microsoft NET is a development environment for creating distributed enterprise applications The main component of NET is the NET Framework which consists of two main parts the common language runtime (CLR) and the NET Framework class library The CLR allows programs to be written in many different programming languages because it translates them into Intermediate Language (IL) IL is the syntax used to send receive and manage NET signals The NET Framework class library includes ASPNET for developing Web applications and Web services Windows Forms for user interface development and ADONET for connection to databases

Other components of Microsoft NET include

Visual Studio NET development system Windows Server 2003 Active Directory directory services Windows Server system components such as SQL Server 2000 and Exchange Server

2003

Unfortunately developing a good framework is expensive A framework must be simple enough to be learned yet must provide enough features that it can be used quickly and catches for the features that are likely to change It must explain the theory of the problem domain and is always the result of domain analysis whether explicit and formal or hidden and informal (Szypeski 98) Therefore frameworks are most likely developed only when many applications are going to be developed within a specific problem area allowing the time savings of reuse to get back the time invested to develop them

Today there are only few component frameworks on the market but their number is growing fast

There are a few technologies that are trying to capture their share of the emerging component technology In the following given detail description about presents the three major technologies and approaches followed today

Mohammad Salah Uddin0857146 Page 23

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 24: An Analysis of Component-based Software Development -Maximize the reuse of existing software

32 NET Framework

The NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services It has two main components the Common Language Runtime (CRL) and the NET Framework Class Library (FCL) The FCL is built on top of the CLR and provides services needed by modern applications While applications targeting the NET Framework interact directly with the FCL the CLR serves as the underlying engine The CLR is the foundation of the NET Framework

The NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code thereby creating a software environment that can exploit both managed and unmanaged features The NET Framework not only provides several runtime hosts but also supports the development of third-party runtime hosts

The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system The illustration also shows how managed code operates within a larger architecture

(Microsoft 2009)

Mohammad Salah Uddin0857146 Page 24

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 25: An Analysis of Component-based Software Development -Maximize the reuse of existing software

This section gives an overview of Microsofts net technology It specially focuses on component related parts of Net such as Common Language Infrastructure and Common language Runtime

321 Common Language Infrastructure

The Common Language Infrastructure (CLI) is developed by Microsoft that describes the executable code and runtime environment that form the core of the Microsoft NET Framework and the free and open source implementations Mono and PortableNET It is a language neutral platform CLI Something like CORBA Unlike CORBA though CLI also defines an intermediate language (IL) and deployment file format (assemblies) such as Java byte code class and JAR files Unlike CORBA and Java CLI include support for extensible metadata (Thai 2001)

CLI provides a virtual execution environment comparable to the one provided by Sun Microsystems for Java programs In both environments CLI and Java use a compiler to process language statements (also known as source code) into a preliminary form of executable code called bytecode Later when a program is run its bytecode is compiled on the fly into the native code required by the machine architecture of a given computer CLI is designed to make it easier to develop programs that can be used as Web services

Common Language Infrastructure specifies

A common language (the Common Language Specification - CLS) A common set of data types that any language must support (the Common Type

System - CTS) An introduction to the component structure How the machine state is managed How exceptions are handled

Any programming language that conforms to CLI criteria can access a common class library and can be compiled into a common intermediate language (bytecode) Once compiled into the common intermediate language any program can then be further compiled into the machine code understood by the specific system it is running on

Within the Common Language Infrastructure a component called the Common Type System (CTS) defines the programming types and operations supported by the NET runtime engine

Mohammad Salah Uddin0857146 Page 25

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 26: An Analysis of Component-based Software Development -Maximize the reuse of existing software

A subset of CTS the Common Language Specification (CLS) determines whether an application is in compliance with specified criteria

Common Language Infrastructure programs can be written in a variety of programming languages including ASP+ C++ and C These are compiled into Microsofts Common Intermediate Language (CIL) which the Common Language Runtime (CLR) then compiles into machine code for processing

322 Common Language Runtime

Common Language Runtime (CLR) lives at the core of NET IT is a platform for software development that provides services by consuming metadata CLR is standards-based and component-oriented Like any platform the important pieces are the runtime the libraries that provide access to them and the languages that can target the platform

(Craig 2004)

The CLR is a component-oriented platform Every piece of CLR functionality that runs must belong to a component - an assembly in CLR parlance Further this component-orientation is deeply rooted in the mechanisms of the CLR to the point where the security subsystem and the loader (among others) have the notion of component baked in

CLR engine is divided into modules that contain code metadata and resources The code is stored in common intermediate language (CIL) format The modules metadata includes the types such as names inheritance relationships method signatures and dependency information The modules resources consist of static read-only data such as strings bitmaps and other aspects of the program that are not stored as executable code

Component development using CLR has numerous attractive benefits such as code reuse proper maintenance of all components by allowing independent bug fixes to each In addition the CLR helps developers in managing both allocation and deallocation of memory This removes two of the largest sources of programmer error leaks and memory corruption

CLR is also helpful for security purposes IT provides permissions to a component based on what process it runs in validates the code based on evidence such as information about code at load time and the website from which component was obtained to assign permissions on a component-by-component basis Moreover CLR checks the code to see if it has been manipulated The metadata in a CLR component can contain a digital signature that can be

Mohammad Salah Uddin0857146 Page 26

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 27: An Analysis of Component-based Software Development -Maximize the reuse of existing software

used to verify that the component was written by genuine person and that it has not been modified You can verily identify if anyone has tried to modify with the code For example if someone tries to change the code of transferring money from the intended recipient to himself the CLR will prevent the altered code from running

Finally CLR is an implementation of common language infrastructure (CLI) specification adding COM+ interoperation and Windows platform access services In particular CLR offers dynamic loading and unloading garbage collection context interception metadata refection remoting persistence and other runtime services that are fully language independent (Thai 2001) Presently Microsoft supports four languages on CLR - C J Managed C++ and Visual Basicnet - that is they are the net software components

33 Enterprise JavaBeans the Sun way

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform This technology enables rapid and simplified development of distributed transactional secure and portable applications based on Java technology And EJB architecture is uses for the development and deployment of robust world class component-based distributed application using the java language

(SDN 2009)

Different people have defined EJB in different way In 2003 Hayden Marchar defines EJB as

ldquoEnterprise JavaBeans (EJB) is an architecture for setting up program components written in the Java programming language that runs in the server parts of a computer network that uses the clientserver modelrdquo

The Enterprise JavaBeans architecture is component architecture for the development and deployment of component-based distributed business applications Applications written using the Enterprise JavaBeans architecture is scalable transactional and multi-user secure These applications may be written once and then deployed on any server platform that supports the Enterprise JavaBeans specification

Mohammad Salah Uddin0857146 Page 27

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 28: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Fig 31 Remote invocation in EJB (Monson-Haefel 2001)

Enterprise JavaBeans is built on the JavaBeans technology which is used for code reuse from GUI development to server-side middle-tier business application development It delivers the speed simplicity and reusability of JavaBeans component development along with the added scalability and security needed for enterprise server applications This technology is also used for distributing program components (which are called Beans using the coffee metaphor) to clients in a network Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added EJB components have the advantage of being reusable in multiple applications To deploy an EJB Bean or component it must be part of a specific application which is called a container

One of the main goals of the Enterprise JavaBeans is to make complex mission-critical issues such as persistence security and transactions transparent to the component developer

Mohammad Salah Uddin0857146 Page 28

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 29: An Analysis of Component-based Software Development -Maximize the reuse of existing software

331 EJB Component Types

There are different types of EJB that can be applied to these different requirements

Session EJBmdashA Session EJB is useful for mapping business process flow (or equivalent application concepts) The EJB architecture contains two types of session beans - stateful and stateless Session EJBs commonly represent pure functionality and are created as needed

(Martin 2004)

The difference between the two is the way in which the bean handles client information The stateful session bean maintains client conversational state information while the stateless session bean does not A stateless session bean is a bean that holds conversations that span a single method call (Roman 2002)

Fig 32 Stateless Session

bean life cycle

A stateful session bean is a bean that is designed to service business processes that span multiple method requests or transactions (Roman 2002) Scaling is a major advantage of stateless beans Because stateless beans dont keep per-client state information different clients can share them at different times

Stateful beans dont scale as well as stateless beans do because stateful beans are assigned to an individual client However the container can passivate a stateful bean to disk to reduce the working set of objects running on the server (Roman 2002) The container will re-activate the bean when its needed providing some scaling benefits to the system

Mohammad Salah Uddin0857146 Page 29

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 30: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Entity EJBmdashAn Entity EJB maps a combination of data (or equivalent application concept) and associated functionality Entity EJBs are usually based on an underlying data store and will be created on the data within that store (Martin 2004)

The idea behind entity beans is to use objects corresponding to database entities and encapsulate access to actual database records (Roman 2002) An entity bean can correspond to a single row in relational table The mapping of entity beans to and from database rows is called persistence

Entity beans can manage their own persistence by directly using JDBC to operate over databases Alternatively they can use container-managed

Persistence driven by object-to-table mappings defined during the deployment process (Roman 2002)

Message-Driven EJBmdashA Message-driven EJB is very similar in concept to a Session EJB but is only activated when an asynchronous message arrives (Martin 2004) Like entity and session beans md-beans reside inside an EJB container But unlike session and entity beans they dont have remote or local interface or home interface The only way to instantiate and use an md-bean is to register it for particular message queue or topic

Mohammad Salah Uddin0857146 Page 30

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 31: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Fig 33 RMI vs Message-driven bean

Message-driven bean is an alternative to remote method invocations (see above figure 33) The idea behind md-bean is that middleman sits between the client and the server (Roman 2002) This middleman receives messages from one or more message producers and broadcasts those messages to one or more message consumers

34 CORBA Architecture

Common Object Request Broker Architecture (CORBA) is an architecture and specification for creating distributing and managing distributed program objects in a network (Hewitt 2006) It allows applications to communicate with one another despite of the different locations and designers through an interface broker CORBA is widely used in Object-Oriented distributed systems including component-based software systems because it offers a consistent distributed programming and run-time environment over common programming languages operating systems and distributed networks (Xia Michael)

The most important and essential concept of CORBA is the Object Request Broker (ORB) which is the middleware that establishes the client-server relationships between components

Figure 34 illustrates the architecture of remote invocation with ORB (Oumlzyurt 2003)

Mohammad Salah Uddin0857146 Page 31

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 32: An Analysis of Component-based Software Development -Maximize the reuse of existing software

In a network ORB supports clients and servers on different computers It means that a client program can request services from a server program or object without having to understand where the server is in a distributed network or what the interface to the server program looks like

Mohammad Salah Uddin0857146 Page 32

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 33: An Analysis of Component-based Software Development -Maximize the reuse of existing software

341 CORBA Component Model

The specification for the CORBA Component Model (CCM) is written to address complexities in the CORBA object model The CCM is part of the CORBA 30 specification which is released 2001(Dave 2001) The CCM extends the CORBA object model by defining features and services that enable application developers to implement manage configure and deploy components that integrate commonly used CORBA services such as transaction security persistent state and event notification services in a standard environment It is a server-side component model for building and deploying CORBA applications It is very similar to Enterprise Java Beans (EJB) because it introduces several new features promises a fully compatible embedding of existing EJB solutions and aims to maintain the original CORBA principle of being both language and platform independent

(Siegel 2000)

This also allows system services to be implemented by the container provider rather than the application developer The benefit and need for these types of containers can be observed through the growth of Application Server software

242 Component Object Model (COM) and Distributed COM (DCOM)

Component Object Model (COM) is a general architecture for component software It allows application and systems to be built from different software providers (Microsoft 2000) It is platform dependent that is Microsoft platforms Windows and Windows NT but language-independent component based applications Its language independency is restricted with the number of languages that are supported by Microsoft for example Java is not there

COM simply defines how components and their clients interact This interaction is defined such that the client and the component can connect without the need of any intermediate system component Specially COM provides a binary standard that components and their clients must follow to ensure dynamic interoperability This enables on-line software update and cross-language software reuse (Damani 1997)

Distributed COM (DCOM) defines the distribution of COMs over a network It is a protocol that enables software components to communicate directly over a network in a reliable secure and efficient manner

Mohammad Salah Uddin0857146 Page 33

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 34: An Analysis of Component-based Software Development -Maximize the reuse of existing software

DCOM is designed for use across multiple network transports including Internet protocols such as HTTP

When a client and its component reside on different machines DCOM simply replaces the local inter-process communication with a network protocol Neither the component nor its client is aware of the network protocols lying between them

343 CCM components

CCM describes a standard application framework for CORBA components It is language-independent Though not dependent on language independent Enterprise Java Beans (EJB) it is a more general form of EJB The important part of the CCM specification is a CORBA container for hosting EJBs This provides the mechanics for two-way interoperability between EJBs in Java and CCM components in any CORBA programming language

It provides an abstraction of entities that can provide and accept services through well-defined named interfaces called ports

Ports are classified into facets receptacles event sources and event sinks (Siegel 2000)

Facets are the potentially multiple interfaces that a component provides to its clients

Receptacles are the client stubs that a component uses to invoke other components

Fig 35 CCM components with their many features (Dave 2001)

Mohammad Salah Uddin0857146 Page 34

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 35: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Event sources are the named connection points that emit events of specified type to one or more interested consumers or to an event channel

Event-sinks are the named connection points into which events of a specified type may be pushed a supplier or an event channel

A component can also incorporate client stubs used to invoke other (non-component) CORBA objects - for example the naming or trader service Other features of the model include

Primary keys which are values that instances of entity components provide to allow client identification of the instances

Attributes and configuration which are named values exposed via accessory and mutators

Home interfaces which provide factory functionality to create new instances

344 Component Implementation Definition Language (CIDL)

The CCM extends the CORBA Interface Definition Language (CIDL) to support all the above features CIDL like IDL relieves developers from having to provide much of the plumbing needed to include components within a container To be exact CIDL is a superset of the Persistent State Definition Language (PSDL) which itself is a superset of IDL Since CIDL is a language to emphasize the description of components it has many new keywords All of these keywords have been added to support the features introduced above

Mohammad Salah Uddin0857146 Page 35

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 36: An Analysis of Component-based Software Development -Maximize the reuse of existing software

4 Case Study Based on Avalon Framework

This chapter presents a component-based case study It explains how a component-based file-sharing program was developed This program is based on the Avalon framework and EJB as component technology The requirements and design decision are first stated and finally the development approach discussed

41 Introduction of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easy to maintain and design of server focused projects In this chapter as a case study Apaches Avalon framework is used to design develop deploy and assemble a component

This framework is used as a case study because it is free released under the terms of the Apache Public License (APL)

For this research a file-sharing-program is implemented using Avalon framework This system allows its users to share files over the Internet or Intranet It is chosen because Avalon frame is suitable for server-side applications This will hopefully give some perception about component-oriented programming based on open software framework

This research uses the connection-oriented TCPIP and itrsquos a client-server paradigm

In the following subsection presents the requirement specification and the design decisions that are used for make the system

42 Problem Statement

Create a client-server system that allows multiple users to share files over the Internet or Intranet The server-side of the system should be a component which is ldquopluggablerdquo to Avalon framework

The Client

Mohammad Salah Uddin0857146 Page 36

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 37: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Implement simple GUI client software to interact with the server When the client is executed the software it prompts the user for their user name and servers host name The system authenticates the user and retrieve from the user list of her shared files

The user will be able to issue queries and view search results or view a list of all available files Users will also be able to download files direct from other users to their local machine

The Server

The server part of the system is a component hosted by Avalon framework Users are able to connect to a ldquoWell-knownrdquo server when they want to share files At this stage the client have to know the server address It is possible to make preconfigured server address if have dedicated server such us Napster server If the users want to share files with other users then they need to send files to the server Then the server keeps all the share files together and makes it available to the clients to make search on it

The users are able to stay connected to the server as long as they want When a user disconnects from the server heshe will be removed from the combined list

43 Phases of Component development

The following phases are used to develop the client-Server component

System requirements Design the component Develop the component Testing

45 System requirements

It is needed to download some essential software to develop the component Like

Avalon framework- on which the component is developed IBM Rational- it is used to design the component Apache Ant- it is used to build the component

Mohammad Salah Uddin0857146 Page 37

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 38: An Analysis of Component-based Software Development -Maximize the reuse of existing software

46 Design the component

461 Design Tools

IBM Rational Rose Software is used to design the Client-server system

462 Component design

The component design is done using IBM Rational software Details component design is given in Appendix

463 Design Documentation

4631 Client Application Interface

The GUI is used as a client application for logging in and issuing query It also shows progress bar while downloading files The application has a pop-up window with the server name and user name textbox The users have to enter the server name and user name when they start the application for connecting with the server

If the connection fails for unauthorised access or invalid server address or invalid user name the same window will pop up again otherwise the program starts a new larger with menu-bar and textbox for search

Though the primary design goal of the system is to verify reusability performance and robustness of component-based system Therefore the GUI design is intentionally kept simple

4632 Functional Design

The server is multi-threaded For this reason multiple clients can make search at the same time through the server where all clients are connected to The server is a Java application that can be run under any JVM-compliant platform Users using different platforms are able to share files as long as they are connected to the internet (or the same intranet) Two client applications are able to run from the same physical machine The shared files can be any sort of media such as text sound or graphic with any size

Mohammad Salah Uddin0857146 Page 38

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 39: An Analysis of Component-based Software Development -Maximize the reuse of existing software

4633 Download Files

Once a client receives a query result from the server user can initiate to download one of the files in the query result Files are downloaded out-of-network ie a direct connection between the source and target client is established in order to perform the data transfer File data are never transfer over the server

47 Component Development

Building Avalon-compliant component (or a component in general) the following is a typical order of operation

471 Develop the component

4711Coding the Component

Coding the component is obviously main task compare to code normal java files It needs to follow all syntax for coding a standard Avalon component For this case study initially two interface files like FileSharingServer and FileSharingServerMBean were created to declare what this component is offering to the host system After that FileSharingSeverImpl class which extends AbstractLogEnabled was created It is a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant After that FileSharingHandler Search and Item have been created to do the business purpose

FileSharingHandler handles all incoming connections from client such as in login out login and enquiries

Search is responsible for searching files The search algorithm is kept simple It uses Vector for keeping the all file names

Item defines the file format as well as the incoming and outgoing package format

After that all the classes have build package deploy and run the component in a framework After running it all the errors have been fixed This is one of the difficulties of developing component because every time I needed to go back to fix the error

Mohammad Salah Uddin0857146 Page 39

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 40: An Analysis of Component-based Software Development -Maximize the reuse of existing software

4712 Assemble

a) Writing configxml assemblyxml and environmentxml

In Avalon each component must contain the following three files

configxml It provides configuration data to each of the components that require configuration data

assemblyxml It defines how the Server Application is assembled from its components This requires naming each component specifying the implementation class for each component and wiring together components

environmentxml It configures environmental or Server Application wide settings This means being able to set the security policy and configure logging settings This file is written in XML and the end-user can view what sort of security policy the component requires The end-user (assembler) can alter the permissions in the security policy if so is desired

b) Build Tool

Apache Ant (Another Neat Tool) software tool is uses for building the component It is open source software and is released under the Apache Software License Ant is designed to be as cross platform as Java Ant uses Java classes and XML scripts to provide an automated way to build applications and to be available on every Java compatible platform (Paul)

Apache Ant is uses to packing the component into JAR and SAR archives The SAR (Server Archive) file format is the standard distribution format of Server Applications It is a standard Jar file with a specific directory layout The configxml environmentxml and assemblyxml file must be stored in SAR-INF directory of the archive All jar files including both those that contain components and those that contain support classes are stored in the SAR-INFlib directory Avalon has a template Ant buildxml file This template is used to create the final buildxml file for component

Mohammad Salah Uddin0857146 Page 40

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 41: An Analysis of Component-based Software Development -Maximize the reuse of existing software

4713 Deploy

Currently deploying a server application under Avalon is simply a matter of dropping the sar file into the directory phoenixapps where the framework looks to load the sar file and starting the server After restarted the Avalon it confirmed that the component was loaded Now the server component is up and running Then a simple client is created to test the server Please refer to the Appendix for client design

4 Start or restart the framework phoenixbinrun[bat|sh]

5 Create optional standalone test client

48 Tests and Result

Software testing is a fundamental component of software quality assurance and represents a review of specification design and coding Testing could find out the bugs and logical errors of the system It is best if someone outside the development group carries out the tests The objectives of Testing are as follows-

bull Testing is a process of executing a program with the aim of finding errors

bull A good test case will have a good chance of finding an undiscovered error

bull A successful test case uncovers a new error

481 Testing Types

There are two types of testing

1 Functional or Black Box Testing2 Structural or White Box Testing

White Box Testing

White Box testing concerned with checking of system representations such as the design diagrams and source code

Using white box testing methods we can derive test cases that

1) Guarantee that all independent paths within a module have been exercised at least once

Mohammad Salah Uddin0857146 Page 41

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 42: An Analysis of Component-based Software Development -Maximize the reuse of existing software

2) Exercise all logical decisions on their true and false sides

3) Execute all loops at their boundaries and within their operational bounds and

4) Exercise internal data structures to ensure their validity

Black Box Testing

Black box testing approaches concentrate on the fundamental requirements of the software Black box testing allows producing groups of input situations that will fully exercise all functional requirements for a program

Black box testing tries to find errors in the following categories

Incorrect or missing functions Interface errors Performance errors Initialisation and termination errors

To satisfy the objectives both white box and black box testing are used The design diagrams and source code have been tested as white box testing Please refer to Appendix A for design diagrams

Black box test is done to find out the unexpected system outputs or behaviour Then during the implementation phase testing has been carried out The errors were encountered during the implementation have been located and repaired After completion of the implementation two tests were particularly interesting

To see that the server component hasnrsquot created any problem after it is been deployed to a system

To test that the communication between server and clients works correctly Such as queries and file transfers

For the security purpose two ports scanning were accepted one is before the server was started and second one while the server was in operation Then the two results were compared to see if the server system opened any new ports to the outside world in the later scanning Avalon is an open source and any one can easily download the source code and see what these ports are for

Mohammad Salah Uddin0857146 Page 42

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 43: An Analysis of Component-based Software Development -Maximize the reuse of existing software

5 Discussion and Evaluation

This chapter evaluates the component-based software and the thesis as whole It starts with comparison among the three major component architectures presented early in this thesis CORBA EJB and COMDCOM This chapter also presents the similarities and difference and among these three technologies After that Case study assessment has presented Finally presents a brief discussion about component-based software development and the possible advantages and disadvantages of adapting to this approach

51 Architecturesrsquo Comparison

The architectural comparison based on component-based approach and also their strengths on specific features are illustrated in the following table This comparison is based on environment interface maintenance etc among the three major component architectures

CORBA EJB COMDCOMDevelopmentenvironment

underdeveloped emerging Supported by a wide range of strong development environments

Binary Interfacing Standard

Not binary standard Based on COM java specific

A binary standard for component interaction is the heart of COM

Compatibility and portability

Particularly strong in standardizing language bindings but no so portable

Portable by java language specification but not very compatible

Not having any concept of source-level standard of standard language binding

Modification amp maintenance

CORBA IDL for defining component interfaces need extra modification amp maintenance

Not involving IDL files defining interfaces between component amp container Easier modification amp maintenance

Microsoft IDL for defining component interfaces need extra modification amp maintenance

Service provided

A full set of standardized service lack of implementations

Neither standardized nor implemented

Recently supplemented by a number of key services

Platform dependency

Platform independent Platform independent Platform dependent

Language dependency

Language independent Language dependent Language independent

implementation Strongest for traditional enterprise computing

Strongest on general Web clients

Strongest on the traditional desktop applications

Mohammad Salah Uddin0857146 Page 43

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 44: An Analysis of Component-based Software Development -Maximize the reuse of existing software

53 Similarities

It is clear that all component technologies have the share characteristics which cannot help to make decisions as to which approach to follow However the rich sharing of characteristics move the decision in favour of using component software technology in the first place whatever the concrete approach is All approaches rely on dynamic polymorphism (some books call inclusion polymorphism or sub typing) encapsulation and late binding mechanisms In addition all approaches support interface inheritance Also all technologies used as on some sort of object model

Most approaches support

A specialized component model for application servers - EJB COM+CCM Uniform data transfer JAR files CLI assemblies Some form of persistence or serialization Deployment descriptors or attribute-based

programming

Mohammad Salah Uddin0857146 Page 44

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 45: An Analysis of Component-based Software Development -Maximize the reuse of existing software

54 Assessment of the major component technologies

This section assesses the different component technologies with respect to the different areas as listed below

Programming languages

CORBA supports multiple programming languages and used on heterogeneous platforms and operating systems there is an ORB implementation for the platform and a language mapping for the programming language DCOM also supports multiple programming languages since it is a binary standard But EJB is language dependent on java and JVM specific

Development support or process

CCM provides 4 step component development process ie design develop assemble and deploy which provides flexibility over 3-steps (design develop and deploy) component development process defined by EJB

Integrated Development Environments (IDE) for CORBA is quite poor compared to the Microsoft development tools

Interface definition

Both CORBA and DCOM offer an interface definition language (IDL) to describe the interfaces for their respective component For both cases the IDL is language neutral and is used to define mappings between different programming languages It is however some differences in both syntax and semantics between the interfaces notions Whereas EJB is not involves with IDL files It defining interfaces between component amp container which is easy to modification amp maintain The Microsoft Interface Definition Language (MIDL) is not like the CORBA Interface Definition Language DCOM support multiple interfaces for a component each representing a different view or behaviour of the component CORBA 30 specification supports this concept where as CORBA 20 specification doesnrsquot

Mohammad Salah Uddin0857146 Page 45

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 46: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Garbage collection

Both Java and DCOM relies totally on garbage collection Java also defines distributed object model and supports distributed garbage collection CORBA does not attempt to perform general purpose garbage collection (zypeski 2002) CLR performs garbage collection and lease-based invalidation of remote references A COM server object keeps track of the clients by using reference counting Java objects have a built-in reference counting where a separate process within the JVM the garbage collector releases instances when no other object has references to the object The DCOM method for garbage collection has been criticised due to increased network traffic

Hardware support

DCOM is mainly supported on the Windows platform but it has been attempts to provide COM on other hardware platforms without being very successful (for instance SOLARIS) CORBA and JavaRMI are supported on nearly all hardware platforms

The main advantage with Java middleware is that the same version of an application can with few changes run on any platform with a compatible JVM

Security

CORBA has defined an own security service to handle authentication of clients It provides security in two levels where level 1 comprises user authentication authorisation data encryption and integrity Level 2 provides a stronger security model where applications are security aware JavaRMI uses the built-in Java security mechanisms

The security model of DCOM is based mainly on the NT LAN Manager security This causes complications for the security of DCOM components if other security protocols or LANrsquos like for instance Novell NetWare are used DCOM expects the user to be authenticated and authorised as a user in the Windows NT domain to control access to the components If Novell NetWare takes care of user authentication and authorisation on the client side and the user is not defined as a Windows NT user this causes authorisation problems on the DCOM server It is however possible to avoid these problems by not using the built-in DCOM server security with the possible consequences this may have on malicious use Another problem with the Windows NT security is scalability and the missing support of delegation Windows 2000 has implemented the Kerberos security model which is more scalable and supports

Mohammad Salah Uddin0857146 Page 46

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 47: An Analysis of Component-based Software Development -Maximize the reuse of existing software

delegation and mutual authentication between the server and the client The EJB architecture encourages the Bean Provider to implement the enterprise bean class without hard-coding the security policies and mechanisms into the business methods In most cases the enterprise beans business method should not contain any security-related logic

Component Models

At present it is true that there are only two competing component models Microsoft and the others While EJB and CCM are fully object-oriented COM+MTS is component based They all provides services like transactions security concurrency and multithreading Scalability is well supported by all models through application server products

Both EJB and CCM provide XML descriptors to label components with packaging and deployment information Also CCM provides assembly descriptors to show how CORBA components should be interconnected Windows NT uses Registry information and type libraries to deploy DCOM components For DCOM installation in Windows 2000 deployment scripts are automatically created for the specific server These deployment scripts can either be installed manually or be downloaded

Most of the application servers products support of all three component models even if the core architecture often is build on top of CORBA architecture DCOM components are normally extended with a CORBA bridge when installed on an application server

Object identity and the life cycle are the biggest difference among the component model COM normally does not implicitly handle state together with the object identity After the COM objet creation the state must be loaded separately The lifetime of a COM object is bounded to the lifetime of its clients and ultimately by the lifetime of the process in which it exist (Rosen 98) A COM object may over its lifetime load and store several distinct identifiable states and be used by several clients Client programs are usually responsible for explicitly managing states and its associations with COM objects Client programs to CCM (CORBA) and EJB objects do not have any notion of state with a separate identity apart from the object that encapsulates it

Mohammad Salah Uddin0857146 Page 47

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 48: An Analysis of Component-based Software Development -Maximize the reuse of existing software

52 Case Study Assessment

In chapter four a file-sharing case study is developed using Avalon framework which serves as a prototype that illustrates various component-oriented concepts and technologies Following presents discussion about the implementation

521 Assessment of Avalon Framework

Avalon framework is a java based open source software which consists of interfaces that define relationships between commonly used application components and several lightweight implementations of the generic components Avalonrsquos focus is server side programming and easing the maintainability and design of server focused projects

Currently Avalon is a parent of five sub-projects Framework Excalibur LogKit Phoenix and Cornerstone Avalon began as the Java Apache Server Framework that had the framework utilities components and a servers kernel implementation all in one project

(AAP 2004)

Avalon provides some useful components and utilities that are included into the client-server system After analysis of Avalon framework the component and Services are implemented to that make the file sharing system

Utilities in Avalon framework is divided into seven main categories Configuration Context Activity Service Logger Parameters Thread and Miscellany It is common for a component to implement several interfaces of these utilities to identify all the concern areas that the component is worried about

Following steps are required for the process of implementing and using a server component based on Avalon framework

Coding the Component It is the main task that takes the most of the time The component must follow all the syntax of writing a standard java classes and a standard Avalon component design such as separation of concern and inversion of control

Associate Metadata with the Component Avalon components have associated metadata that declares what resources they are capable of providing to other the components and what resources they need to be provided by other the components or the host framework The Avalon metadata specification is an extensible mechanism to attach metadata to components

Mohammad Salah Uddin0857146 Page 48

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 49: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Package the component and related resources into a SAR file The final step is packaging up the implementation files Meta descriptors and other resources into a sar file

To implement the client-server case study some interfaces are used from in the main class (FileSharingServer) which taken from the Avalon Those interfaces are given below-

public class FileSharingServerImplextends AbstractLogEnabledimplements Contextualizable Serviceable ConfigurableInitializable DisposableConnectionHandlerFactory

The system is kept as secure as possible and explicitly tracks whether the component is fully initialized or not Since specific information about the environment may change or may need to be customized Configurable interface is also implemented for the system The component makes use of other components and the method that Avalon provides to get instances of the required component is by using a ServiceManager The system needed to implement the Serviceable interface to get an instance of the ServiceManager

After implementing these interfaces and other support classes system needed to write the configuration files Avalon has configuration files and they allow an administrator to alter vital configuration information Avalon can read a configuration file in XML format and build the components in a system from it

Source modules

The file-sharing server comprises of the following main modules all contained within the src directory

FileSharingServer Contains the Java source for server component Confassemblyxml contains the assembly instructions for the resulting server archive

(SAR) file Confconfigxml contains the configuration for the resulting server archive (SAR)

file Confenvironmentxml Contains instructions about the environment and logging

Mohammad Salah Uddin0857146 Page 49

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 50: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Component Deployment

Currently deploying a server application under Avalon is simply a matter of dropping the sar (Server ARchive) file into the appropriate directory (apps) Avalon supports hot deployment applications can be added removed and updated in the application directory without restarting the framework

53 Assessment of the Approach

Component-based framework requires both component systems that support the approach and component developers that follow its core principles and its discipline Nevertheless it is hard to tell the difference between a true core principle and a mere feature of a component framework

There is a single common key feature of component technology that seems to cause most technical difficulties Components come from separate sources and are deployed by third parties Even if a component fails to function it must not violate system-wide rules For that reason component safety and language independency are important core principles

The following subsection presents the discussion about the important core principles component technologies and compare how Avalon framework put them into practice

531 Component Security

In component-based programming components are developed independently from the client applications that will use them Component developers have no knowledge of how end user or client application will try to use their work The component could have been used maliciously to corrupt data or to hack to a system without proper authentication or authorization Similarly a client application has no knowledge of how the component it is interacting with is internally implemented It could well be a malicious component that abuses the credentials the client provides In addition even if both the component and the client have no bad intent the end user could still try to hack into the host system or do some other damage (even by accident) To minimize the danger a component framework needs to provide a security infrastructure to deal with such scenarios

Mohammad Salah Uddin0857146 Page 50

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 51: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Avalon Framework Security

Security in Avalon framework is mainly based on Java security model Avalons Guardian Component is used to manage permissions based on properties of the code and who is running the code The Guardian loads its permission sets from a database or configuration file It uses the standard Java security model to enforce access to the resources which a specific component may request

The Guardian component uses a security policy to decide which individual access permissions are granted to running code These permissions are based on the codes characteristics such as where it is coming from who is running it whether the code is digitally signed and if so by whom Attempts to access protected resources raise security checks that compare the needed permissions for the attempted access with the granted permissions If a security policy is not explicitly given the default policy is used which is the classic ldquosandboxrdquo policy as implemented in JDK 10 and JDK 11

The sandbox is customizable Java security model which allows each restricted piece of software to run within its own restricted ldquosandboxrdquo The program must ldquoplay ldquoonly inside its sandbox It can do anything within the boundaries of its sandbox but it cannot take any action outside these boundaries

Java security model is one of the languages key architectural features which make it a proper technology for networked environments

532 Language Independence

In CBSE the client interacts with the server independently so the client is developed independently of the server It interacts with the server component only at runtime Consequently the programming languages that implement the client and server components should not affect their ability to interact with each other at runtime Language independence means exactly that programming language should be irrelevant to develop a component Programming language independence promotes the interaction of components and their adoption and reuse in general

Mohammad Salah Uddin0857146 Page 51

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 52: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Avalon programming language

Avalon framework is basically Java Apache Server Framework It has the own framework components utilities and a servers kernel implementation all in one project It is the basis for all Java server code at Apache Since then Java is the only programming language used in Avalon framework

Java is platform independent and is widespread programming language So might be this is the main reason why Avalon architects preferred and targeted Java as the Avalon programming language

54 Component designing methods for Reuse

The main purpose of designing component methods for reuse is to increase higher productivity taking advantage of best-in-class solutions and the consequent improved quality of the component In reality to achieve significant levels of reuse component is not so easy It must be carefully analyzed designed before developed

CBSE follows two kinds of methods for designing reusable components These are given below-

Designing with reuse Itrsquos a new designing solution by combining existing reusable components Search and retrieval are the main activities here For example copying source code from the existing is the lowest level of software reuse Function libraries are better form of reuse than copying source code but it is not extensible Class libraries are improved form of reuse and they are extensible Nevertheless it requires deep knowledge before classes can be reused The client code will be affected if internals of classes changed For example in an object-oriented language such as Java or C++ extended classes are coupled to the parent class implementation Changes in any of the parent classes in the hierarchy of the inheritance would break extended classes (Wang 2005)

Reusing component supports highest level of software reuse because it allows various types of reuse including black-box reuse and white-box reuse White-box reuse means that the source code of a component is made available and can be studied modified adapted and reused Black-box reuse is the highest level and it is based on the principles of information hiding The component interface defines the services client software may request from the

Mohammad Salah Uddin0857146 Page 52

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 53: An Analysis of Component-based Software Development -Maximize the reuse of existing software

component (Wang 2005) The client software has no knowledge about the component internals and how the interface is implemented On the other hand the component provides the implementation of the interface that the clients rely on As long as the part of the interface which the client is interacting remains unchanged components can internally be changed without breaking clients

Designing for Reuse It is the major task of the two activities and it is about analyzing designing implementing and documenting components for future reuse

This designing method each component provides two types of interfaces

Component provided interface which specifies the public services that component provides to its clients

Component required interface which defines the services that component requires from the underlying infrastructure in order to function properly

This designing method requires both system infrastructures which supports the approach and component designer that follow component-based software development principles This method should possess the characteristics of sound engineering loose coupling tight cohesion and sufficient capabilities One of the major challenge of this methods is to predict the future use of the software that are about to design and implement Even though designing component for reuse has been practiced over many years but it is still a relatively young discipline and it is not yet clear what is feature of the component technology being used or true principle of component reuse

55 Component Search

One of the major obstacles of the component-based software development is to find suitable components Developers are facing problem to find appropriate components for lack of component search tools Searching and subsequently selecting reusable components from component repositories has become a key problem for component-based development and also for achieving the overall usability of the components themselves

Current component models have made component-based software development practical Nevertheless these models are limited to support for the specificationcharacterization of software components mainly deals with structure and syntactic issues To avoid mismatch and misuse of components more common specification of software components is required

Mohammad Salah Uddin0857146 Page 53

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 54: An Analysis of Component-based Software Development -Maximize the reuse of existing software

especially in a situation where components are dynamically discovered and used at run-time over company intranets and the Internet (Han 1999)

Component matching a basic aspect of the component search problem has been well-studied problem (Frakes 1994) resulting in many different matching techniques such as facet keyword signature and specification matching techniques Nevertheless each matching technique when individually used for component search often produces a large or small number of (sometimes irrelevant) hits There have been industrial and experimental projects that build systems from existing components the approaches taken are ad hoc and heavily rely on the specifics of the components and systems concerned That is component-based software development is still very much in its childhood

Mohammad Salah Uddin0857146 Page 54

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 55: An Analysis of Component-based Software Development -Maximize the reuse of existing software

6 Conclusion

This chapter presents the final summaries about the dissertation title and subtitle which includes analysis of component based-software engineering and maximize the reuse of existing software

Analysis of component-based software engineering

This dissertation already described and analyzed about the major component based software technologies But it is found that the entire current component based development technologies facing many challenges in different fields some of which are summarised like finding trusted component Long-term management of component-based systems Development models Component configurations Dependable systems and CBSE Component certification Composition predictability Requirements management and component selection Tool support All are considerable because CBD and CBSE are in the very first phase of their lives CBD is recognized as a new powerful approach that will if not revolutionise at least significantly change the development of software and software use in general

Maximize the reuse of existing software

One of the major goals of Software component technology is to maximize the reuse of existing software components An obvious advantage of this approach is that overall development time is reduced Fewer software components need be specified designed implemented and validated However time reduction is only one potential advantage of reuse Systematic component reuse in the development process offers further advantages

1 System reliability is increased reused components which have been exercised in working systems should be more reliable than new components These components have been tested in operational systems and have therefore been tested to realistic operating conditions

2 Overall process risk is reduced if a component already exists there is less uncertainty in the costs of reusing that component than in the costs of development This is an important factor for project management as it reduces the uncertainties in project cost estimation This is particularly true when relatively large components such as sub-systems are reused

Mohammad Salah Uddin0857146 Page 55

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 56: An Analysis of Component-based Software Development -Maximize the reuse of existing software

3 Effective use can be made of specialist Instead of application specialists doing the same boring work on different projects these specialists can develop interesting new reusable components which encapsulate their knowledge

4 Software development time can be reduced Bringing a system to market as early as possible when it is mostly wanted is often more important than overall development costs Reusing components speeds up system production because both development and validation time should be reduced

Along with the component-based software advantages there are also some disadvantages

Components have often only a brief description of their functionalities It is hard to guarantee critical system-wide properties in the presence of arbitrary

third-part components There are no or only a limited description of the quality of the component (Crnkovic

2003)

There is considerable indication that software component technology is emerging as a major factor in how systems are being and will be built for the near future and many computer scientists are hoping that it will bring solutions to all the problems that led to software crisis However as it is currently it is still immature for most companies to jump to implementation now

Mohammad Salah Uddin0857146 Page 56

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 57: An Analysis of Component-based Software Development -Maximize the reuse of existing software

7 Achievements

Doing this dissertation has been very instructive and interesting Because almost I am going to achieve the Masters degree in Information Technology but before selecting this dissertation topic I had a few knowledge about component based software technologies But I knew that at present CBSE is the most demanding and promising technology Thatrsquos why I was so interested to work on this topic But now after finishing this dissertation I would say that at least I have gained some knowledge about component based software engineering and its uses and future However I have to admit that the dissertation has had its difficult days I decided early to use Avalons framework for implementing my prototype component for the simple reason that the framework is written in Java and is freely downloadable In addition development of Avalon framework is hosted at Apache known its successful Apache web server project among other successful projects

For the case study creating the component was a headache I have used Avalon frame work and Ant build tool for the client-server component developments I have used Avalons build-file template to create my components build-file and after I run Ant to build the component it started printing out long stack of errors It took me a long time to fix those errors The main problem was that the Avalons development documentation was not developer-friendly

To conclude I have successful to achieve my objectives of this dissertation In the course of this dissertation I have initially defined component-based soft-ware and related technology such as component framework component system architecture I also explained about components frameworks deployed and assessment three main component technologies namely CORBA CCM EJB and Net In addition I also explained importance of reuse of existing software Finally I designed implemented assembled and tested a simple component-based file-sharing-server on Avalon framework

Mohammad Salah Uddin0857146 Page 57

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 58: An Analysis of Component-based Software Development -Maximize the reuse of existing software

References

Atkinson C Bayer J Laitenberger O Zettel J ldquoComponent-Based Software Engineering The KorbA Approachrdquo httpse2unilutikise2c-bib_downloadphpid=700 last access 10062009

Bachman F Bass L Buhman C Comella-Dorda S Long F Robert J Seacord R Wallnau K ldquoVolume iiTechnical Conecpts of Component-Based Software Engineeringrdquo httpwwwseicmuedupubdocuments00reportpdf00tr008 last access01062009

Bellur Umesh ldquoThe Role of Components amp Standards in Software Reuserdquo

httpwwwobjscomworkshopsws9801paperspaper012pdf last access 13082009

Cheesman J and Daniels JrdquoUML components a simple process for specifying Component-based softwarerdquo Addison-Wesley Boston USA 2001

CORBA ldquoCORBA Component Model specificationrdquo Volume - 1 1999 wwwomgorg

Cox B ldquoObject-oriented programming an evolutionary approachrdquo Addison-Wesley Reading UK 1986

Craig A ldquoNET Common Language Runtime (CLR) Tutorialrdquo 20062009

httpwwwtheserversidenetttarticlesshowarticletssid=DM_CLR

Crnkovic Ivica ldquoComponent-based Software Engineering ndash New Challenges in Software Developmentrdquo in 27th Int Conf Information Technology Interfaces ItI 2003 June 1-19 2003 Cavtat Croatia

Damani OP Wang YM Lee WJ ldquoReliability and Availability Issues in Distributed Component Object Model (DCOM)rdquo Fourth International Workshop on Community Networking Proceedings 1997 pp 59 ndash63

Dave Bartlett ldquoCORBA Component Model (CCM)rdquo 01 Apr 2001

httpwwwibmcomdeveloperworkslibraryco-cjct6

Mohammad Salah Uddin0857146 Page 58

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 59: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Emmerich W ldquoDistributed Component Technologies and their Software Engineering Implicationsrdquo May 1925 2002 ACM Press

Frakes W Pole T ldquoAn Empirical Study of representation Methods for ndash Reusable Software Componentsrdquo IEEE Transactions on Software Engineering Vol-20 1994

Han Jrdquo International Workshop on Component Based Software Engineeringrdquo Los Angeles USA 1999

Hayden Marchant ldquoEnterprise JavaBeansrdquo last update 24 Mar 2003

Heineman G Councill W ldquoComponent-Based Software Engineeringrdquo Addison-Wesley 2001

Herzum P SIMS Oliver Business Component Factory Wiley 1999

Hewitt j Roets C and Walker A ldquoCORBArdquo last update 10 jul 2006

httpsearchsqlservertechtargetcomsDefinition0sid87_gci21386500html

Homer Lemar Component Based Software Engineering March 30th 2005

Kozak Ayse ldquoComponent-Oriented Modelling Of Land Registry and Cadastre Information System Using COSEMLrdquo Master Thesis 2002

Kruchten P ldquoModeling Component Systems with the Unified Modeling Languagerdquo

httpciscstu=berlindeLehreWs-0001Sonstigeskonteng_sempapersModeling_Component_systems_with_UMLpdf

Lefebvre Eric Levesque Ghislain ldquoEnterprise-Component Modelrdquosrdquo

httpwwwlrgluqamcapublicationspdf380pdf last access 20082009

Martin Bond ldquoIntroduction of Enterprise JavaBeansrdquo 21-08-2009

McIlroy M D ldquoMass Produced Software Componentsrdquo In P Naur and B Randell editors Software Engineering pages 138ndash155 Brussels 1969 Scientific Affairs Division NATO Report of a conference sponsored by the NATO Science Committee Garmisch Germany 7th to 11th October 1968

Mohammad Salah Uddin0857146 Page 59

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 60: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Microsoft httpwwwmicrosoftcomisapi Mar 2000

Microsoft (msdn)rdquoNET Framework Developer Centerdquor copy 2009 Microsoft Corporation last access 02-9-09 httpmsdnmicrosoftcomen-uslibraryzw4w595w(VS71)aspx

Monson-Haefel Richard ldquoEnterprise JavaBeansrdquo OrsquoReilly 3rd edition 2001

Oumlzyurt B ldquoEnforcing Connection-Related Constraints and Enhancements on a Component Oriented Software Engineering CASE Toolrdquo Master Thesis 2003

Paul T ldquoAnt What is Antrdquo httpwwwjavaranchcomjournal200203anthtml

Pour Gilda ldquoComponent-Based Software Development approach New Opportunities and Challengesrdquo Proceedings of the 26th International Conference on Technology of Object-Oriented Languages and Systems 1998

Roman Ed ldquoMastering Enterprise JavaBeans and the Java 2 Platformrdquo Enterprise Edition John Wiley amp Sons New York USA 2002

Rosen M Curtis D ldquoIntegrating CORBA and COM Applicationsrdquo John Wiley amp Sons 1998

Siegel JrdquoCORBA 3 Fundamentals and Programmingrdquo 2nd Ed John Wiley amp Sons New York USA 2000

Siddique F ldquoComponent Based Software Engineering-A look at reusable software componentsrdquo wwwsmbuklinuxnetreusability

Sommerville ldquoSoftware Engineering Seventh editionrdquo page 462-463 Szypeski C Component Software Beyond Object-Oriented Programming Addison-Wesley Harlow UK 1998

Sommerville I ldquoSoftware Engineeringrdquo Addison-Wesley Harlow UK 1999

Sun Developer Network ldquoEnterprise JavaBeans Technologyrdquo Copyright 1994-2009 Sun Microsystems Inc

Szypeski C ldquoComponent Software Beyond Object-Oriented Programmingrdquo 2nd Ed Addison-Wesley Harlow UK 2002

Mohammad Salah Uddin0857146 Page 60

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 61: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Thai T Lam H ldquoNET Framework Essentialrdquo OReilly Sebastopol USA 2001

TraczW ldquoWhere Does Reuse Startrdquo Proc Realities of Reuse Workshop Syracuse University CASE Center January 1990

The Apache Avalon Project ldquoThe Avalon Project Management Committeerdquo 2004

httpavalonapacheorgclosedhtml

Wang Ju An ldquoTowards Component-based software Engineeringrdquo journal of Computing Science in Colleges Volume 16 Issue 1(October 2000) Page 177-189 2000

Wang Ju An ldquoComponent-oriented Programmingrdquo March 2005

Xia Cai Michael R Lyu Kam-Fai Wong Ko Roy ldquoComponent-Based Software Engineering Technologies Development Frameworks and Quality Assurance Schemesrdquo

httpwwwcsecuhkeduhk~lyupaper_pdfapsecpdf last access 13092009

Mohammad Salah Uddin0857146 Page 61

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 62: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Appendix A

Case Study design specification

Introduction

This section presents the design specification of client-server program It is used UML (Unified Modeling Language) to design the client-server system Because UML is still expected for Component based system design As a UML tool IBM Rational Rose is used to design the use case Sequence diagram and Class diagram

Fig 1 Client use case diagram

Event List for Client-server system

1 User logon the system2 User issue query 3 User download file from the system4 User disconnect from the server

Mohammad Salah Uddin0857146 Page 62

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 63: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Following presents the Use Case Narrative for each of the use cases

Use Case Narrative

Use case Log on

Actors User

Purpose To log on the server

Overview User enter the Hostname and Username

to log on the system

Type Essential

Pre-condition User must have the client software

Post-condition User must authenticated by the server

Special Requirements System should response within 5

seconds

Flow of Events

Actor Action System Response

User start the client software

User enters hostname and username and clicks

on ldquoOKrdquo button

The application pops up the ldquoLog onrdquo window

prompting user to enter serverrsquos hostname and userrsquos

desired username

Server verify the hostname and username

The client application initially scans Userrsquos shared folder

and sends a list of all file names in the shared folder to

the server

Alternative flow of event

User is prompted again if the user enters username and hostname duplicate or unknown

Mohammad Salah Uddin0857146 Page 63

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 64: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Use case Issue Query

Actors User

Purpose To search file

Overview It use case is used to search desire file

from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition Client receives the query result

Special Requirements System should response within 10

seconds

Actor Action System Response

User enters the file name in the Search text

field

User clicks on ldquoSearchrdquo buttonThe search file is sent to the server via TCPIP

connection

Server makes search and sends back any match to the

client

Alternative flow of event

Client application times out if there is no match on Userrsquos search string

Use case Download File

Actors User

Purpose To download file

Overview This use case is used to download search

files from server to local machine

Type Essential

Pre-condition User has to successfully logged on

Mohammad Salah Uddin0857146 Page 64

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 65: An Analysis of Component-based Software Development -Maximize the reuse of existing software

User issued query

User received query result from the server

Post-condition User downloads files to the local machine

Special Requirements System should responses as fast as

possible

Actor Action System Response

User double clicks the desired match

The client application establishes TCPIP connection to

the remote Client

Use case Disconnect

Actors User

Purpose To disconnect from the server

Overview This use case is used to disconnect the

user from the server

Type Essential

Pre-condition User has to successfully logged on

Post-condition The client application informs the server that it want

to disconnect

The client application shuts down

Special Requirements System should response within 5

seconds

Mohammad Salah Uddin0857146 Page 65

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 66: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Actor Action System Response

User chooses Exit from the File menu or clicks

the close XServer disconnects the user

Sequence diagram

Following presents the sequence diagram for each of the use case of client-server system

Sequence diagram for log on the system

Mohammad Salah Uddin0857146 Page 66

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 67: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Sequence diagram for issue query from the system Sequence diagram for issue query from the system

Sequence diagram for download file from the system

Mohammad Salah Uddin0857146 Page 67

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 68: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Sequence diagram for disconnect from the system

Mohammad Salah Uddin0857146 Page 68

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 69: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Class Diagram

Server Class diagram

Four classes and two interfaces are made for the server Four classes are Item FileSharingHandler Search and FileSharingServerImpl which extends AbstractLogEnabled a logging class in Avalon framework The class also implements the two interfaces and some of Avalons interfaces which the component needs These interfaces are Serviceable Configurable Initializiable Disposable and ConnectionHandlerFactory The FileSharingServerImpl class makes the component Avalon-compliant Two Interfaces are FileSharingServerMBean and FileSharingServer Attributesand data types of the four classes are given below

Attributes of Item class

itemName(String) username(String) hostname(String)size(double) port(integer) length(integer)

Attributes of FileSharingHandler class

Username(String) item(Item) commando(String) in(DataInputStream) ok(boolen)

Attributes of Search class

Socket(Socket) commando(String) ut(DataOutputStream)

Attributes of FileSharingSeverImpl class

socketManager(SocketManager) connectionManager(ConnectionManager) context(BlockContexr) greeting(String) port(Interger) connectionName(String) serverSocket(ServerSocket)

Mohammad Salah Uddin0857146 Page 69

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 70: An Analysis of Component-based Software Development -Maximize the reuse of existing software

The relationship among the classes and interfaces are shown in the server class diagram

Server class diagram

Client Class Diagram

Six classes are used for the client server the relationship among the classes are shown in the client class diagram

Client class diagram

Mohammad Salah Uddin0857146 Page 70

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 71: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Screenshot

Login screenshot

Screenshot of a search result

Mohammad Salah Uddin0857146 Page 71

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A
Page 72: An Analysis of Component-based Software Development -Maximize the reuse of existing software

Screen shot of downloading file

Mohammad Salah Uddin0857146 Page 72

  • Abstract
  • 1 Introduction
    • 11 Aims and Objectives
    • 12 Initial Review
    • 13 Method of Approach
      • 2 Component
        • 21 Component definition
        • 22 Component Characteristics
        • 23 Relation between Component and Object
        • 24 Difference between Component and Object
        • 25 Differences between CBSE and Traditional SE
        • 26 The most significant benefits of using CBSE
        • 27 Importance of Reusability
          • 271 Why is reuse important
          • 272 Is reuse really going to happen this time around
          • 273 How do we measure reuse
            • 28 Compromises for reuse components
            • 29 Component Technologies
            • 29 Component Modelling Languages
              • 3 Component Frameworks
                • 31 Component Framework Definition
                  • 311 Java 2 Platform Enterprise Edition (J2EE)
                  • 312 Microsoft NET
                    • 32 NET Framework
                      • 321 Common Language Infrastructure
                      • 322 Common Language Runtime
                        • 33 Enterprise JavaBeans the Sun way
                          • 331 EJB Component Types
                            • 34 CORBA Architecture
                              • 341 CORBA Component Model
                              • 242 Component Object Model (COM) and Distributed COM (DCOM)
                              • 343 CCM components
                              • 344 Component Implementation Definition Language (CIDL)
                                  • 4 Case Study Based on Avalon Framework
                                    • 41 Introduction of Avalon Framework
                                    • 42 Problem Statement
                                    • 43 Phases of Component development
                                    • 45 System requirements
                                    • 46 Design the component
                                      • 461 Design Tools
                                      • 462 Component design
                                      • 463 Design Documentation
                                        • 4631 Client Application Interface
                                        • 4632 Functional Design
                                        • 4633 Download Files
                                            • 47 Component Development
                                              • 471 Develop the component
                                                • 4711Coding the Component
                                                • 4712 Assemble
                                                • 4713 Deploy
                                                    • 48 Tests and Result
                                                      • 481 Testing Types
                                                        • White Box Testing
                                                        • Black Box Testing
                                                          • 5 Discussion and Evaluation
                                                            • 51 Architecturesrsquo Comparison
                                                            • 53 Similarities
                                                            • 54 Assessment of the major component technologies
                                                            • 52 Case Study Assessment
                                                              • 521 Assessment of Avalon Framework
                                                                • 53 Assessment of the Approach
                                                                  • 531 Component Security
                                                                  • 532 Language Independence
                                                                    • 54 Component designing methods for Reuse
                                                                    • 55 Component Search
                                                                      • 6 Conclusion
                                                                        • Analysis of component-based software engineering
                                                                        • Maximize the reuse of existing software
                                                                          • 7 Achievements
                                                                          • References
                                                                          • Appendix A