Architecture for customizable component system

A component customization and distribution system in an object-oriented environment provides a template builder utility which enables a base component to be selectively modified and the modifications to the base component stored as a template. The template is formatted into a distribution pack which may be then distributed to a recipient computer system having a similar base component loaded thereon. A loader utility utilizes the information contained within the template inconjunction with the functionality of the base component to modify the behavior of the base component to conform to the customizations or modifications created with the template builder utility. The component loader utility spoofs the base component by selectively forwarding method calls to/from the base component and selectively modifying the results of method calls in response to information contained in the template.

COPENDING APPLICATIONS 
This application is the one of five U.S. patent applications filed on an 
even date herewith and commonly assigned, including: 
Ser. No. 08/910,366, Attorney Docket No. L09-97-015, by Jeffrey J. Buxton, 
et. al. entitled "Method and Apparatus for Building Templates in a 
Component System"; 
Ser. No. 08/910,144, Attorney Docket No. L09-97-039, by Jeffrey J. Buxton, 
entitled "Method and Apparatus for Storing Templates in a Component 
System"; 
Ser. No. 08/909,753, Attorney Docket No. L09-97-006, by Jeffrey J. Buxton, 
et. al. entitled "Method and Apparatus for Loading Components in a 
Component System"; and 
Ser. No. 08/910,140, Attorney Docket No. L09-97-038, by Jeffrey J. Buxton 
entitled "Method and Apparatus for Distributing Templates in a Component 
System. 
The subject matters of the above-identified copending patent applications 
are hereby incorporated herein by reference. 
FIELD OF THE INVENTION 
This invention relates generally to improvements in computer systems, and, 
more particularly, to a system for creating and distributing customized 
applications. 
BACKGROUND OF THE INVENTION 
In the evolution of data processing systems, much of the functionality 
which previously had been performed by hardware system components is now 
being constructed utilizing software programming instead. Such an approach 
disfavors proprietary hardware architectures and encourages open system 
architectures on which a multitude of software algorithms can be executed 
on a common hardware architecture. As a result, software programs or 
applications have become more powerful and increasingly complex. 
Unfortunately, numerous difficulties arise in the development and 
maintenance of such software applications. Traditional applications have 
become so large and complex that even minor changes may take several weeks 
or months to implement. Accordingly, the trend in both software 
development and program language development is towards more modular, 
self-contained software designs. 
One of the major developments in the field of software design has been the 
emergence of object-oriented technology. As explained in greater detail 
hereinafter, object-oriented technology enables the analysis, design and 
implementation of software systems with intelligent, autonomous agents 
called objects. Such objects facilitate the design of modular software 
which more closely mimics the physical or logical entities within the real 
world. 
Despite the emergence of object-oriented technology most end-users have 
been typically unable to directly utilize the efficient, more modular 
design of an application, even if the application has been designed using 
object-oriented technology. For example, users of applets, i.e., small 
applications such as spreadsheets and file viewers, typically wish to 
customize such applications for their own preferred tasks and to allow 
such applications to interact with one another to form larger customized 
applications without having to redesign or make extensive modifications to 
such applications. Further, even if such applications were modifiable, 
their inherent value is often directly related to the ability to 
distribute such customized applications with accompanying data in a manner 
which is both efficient and respects the intellectual property rights of 
the authors. Accordingly, a need exists for a system of intelligent, 
self-contained software modules which may be used to construct larger 
applications in a modular fashion. Further, a need exists for a technique 
in which software applications may be modified as desired by an end-user 
in the manner which is both simplified and efficient. 
A further need exists for a technique in which such modifications to 
standard applications may be distributed and used in an efficient manner. 
In addition, a need exists for a technique in which use and distribution 
of such customized application may be performed only by those who are 
properly authorized by the software licensor. 
SUMMARY OF THE INVENTION 
The present invention provides a component system in which a number of base 
applications, i.e. components, such as file viewers, spreadsheets, 
draw/diagram utilities, etc. may be customized by a user and the 
customizations, i.e., the differences from the base applications, 
distributed in the form of a template to another user having the same base 
applications on his/her system. A special loader utility, when used in 
conjunction with the template and the base application from which the 
template was derived, enables the recipient system to recreate the 
behavior of the customized application. 
The invention is contemplated for use in object-oriented system in which 
components are implemented as objects. A template builder utility allows a 
user to select a base component, modify the persistent data of the 
component, and store the modifications as a template in a predetermined 
format. The template builder utility further enables the user to package 
templates in a template distribution package format which enables the 
templates to be distributed to other users having the same base components 
installed on their systems. A component loader utility loads the template 
onto a recipient user system and utilizes the information contained within 
the template distribution pack to spoof the already installed base 
component. The method of spoofing is achieved using aggregation of object 
properties so that method calls to the template component are selectively 
directed to the base component by the component loader utility. The 
component loader utility, however, reserves the right of changing, 
enhancing or disabling the results of the method call to recreate the 
behavior of the customized or template component. 
According to one aspect of the present invention, an apparatus for creating 
templates of customizations to a base component comprises component loader 
logic configured to load a base component on to the computer system, 
template builder logic configured to enable selection of a base component 
and modification of persistent data of the base component, template stored 
logic configured to format the modifications to the base component into a 
template format suitable for storage, and a template storage file for 
storing one or more templates therein. In one embodiment, a distribution 
pack generator responsive to the template builder logic and the template 
storage file generates a template distribution pack containing at least 
one template and a template installer program. In another embodiment, the 
template contains not only modifications to the persistent data of the 
base component but also user-defined instructions relating to such 
modifications as well as one or more keys into the operating system file 
registry where information about the base component resides. 
In accordance with a second aspect of the present invention, a computer 
program product for used with an object-oriented computer system having an 
operating system capable of executing one or more base components 
comprises a computer usable medium having program code embodied on the 
medium. The program code comprises code responsive to a base component for 
loading of the base component on the computer system, and code defining at 
least one base component. In one embodiment, the medium further comprises 
program code defining a template storage file and program code for storing 
template data in the template storage file. In another embodiment, the 
medium contains additional program code responsive to the base component 
and the template data for selectively forwarding method calls to the base 
component and selectively modifying results of the method call to modify 
behavior of the base component as defined by template data. 
In accordance with the third aspect of the present invention, a method of 
customizing components in an object-oriented computer system includes the 
steps of electing a base component, modifying the state of persistent data 
of the base component, saving the modifications to the base component, and 
formatting the modifications into a template suitable for utilization on 
another system having the same component.

DETAILED DESCRIPTION 
FIG. 1 illustrates the system architecture for a computer system 100 such 
as an IBM PS/2.RTM., on which the invention may be implemented. The 
exemplary computer system of FIG. 1 is for descriptive purposes only. 
Although the description may refer to terms commonly used in describing 
particular computer systems, such as in IBM PS/2 computer, the description 
and concepts equally apply to other systems, including systems having 
architectures dissimilar to FIG. 1. 
Computer system 100 includes a central processing unit (CPU) 105, which may 
be implemented with a conventional microprocessor, a random access memory 
(RAM) 110 for temporary storage of information, and a read only memory 
(ROM) 115 for permanent storage of information. A memory controller 120 is 
provided for controlling RAM 110. 
A bus 130 interconnects the components of computer system 100. A bus 
controller 125 is provided for controlling bus 130. An interrupt 
controller 135 is used for receiving and processing various interrupt 
signals from the system components. 
Mass storage may be provided by diskette 142, CD ROM 147, or hard drive 
152. Data and software may be exchanged with computer system 100 via 
removable media such as diskette 142 and CD ROM 147. Diskette 142 is 
insertable into diskette drive 141 which is, in turn, connected to bus 130 
by a controller 140. Similarly, CD ROM 147 is insertable into CD ROM drive 
146 which is, in turn, connected to bus 130 by controller 145. Hard disk 
152 is part of a fixed disk drive 151 which is connected to bus 130 by 
controller 150. 
User input to computer system 100 may be provided by a number of devices. 
For example, a keyboard 156 and mouse 157 are connected to bus 130 by 
controller 155. An audio transducer 196, which may act as both a 
microphone and a speaker, is connected to bus 130 by audio controller 197, 
as illustrated. It will be obvious to those reasonably skilled in the art 
that other input devices, such as a pen and/or tabloid may be connected to 
bus 130 and an appropriate controller and software, as required. DMA 
controller 160 is provided for performing direct memory access to RAM 110. 
A visual display is generated by video controller 165 which controls video 
display 170. Computer system 100 also includes a communications adaptor 
190 which allows the system to be interconnected to a local area network 
(LAN) or a wide area network (WAN), schematically illustrated by bus 191 
and network 195. 
Operation of computer system 100 is generally controlled and coordinated by 
operating system software, such as the OS/2.RTM. operating system, 
available from International Business Machines Corporation, Boca Raton, 
Fla. or Windows 95 from Microsoft Corp., Edmond, Wash. The operating 
system controls allocation of system resources and performs tasks such as 
processing scheduling, memory management, networking, and I/O services, 
among things. In particular, an operating system 210 resident in system 
memory and running on CPU 105 coordinates the operation of the other 
elements of computer system 100. The present invention may be implemented 
with any number of commercially available operating systems including OS2, 
UNIX Windows NT and DOS, etc. One or more applications 202 such as Lotus 
Notes, commercially available from Lotus Development Corp., Cambridge, 
Mass., may be executable under the direction of operating system 215. If 
operating system 215 is a true multitasking operating system, such as OS2, 
multiple applications may execute simultaneously. 
FIG. 2 illustrates conceptually the component system 200 in accordance with 
the present invention. In a preferred embodiment, the elements of 
component system 200 are implemented in the C++ programming language using 
object-oriented programming techniques. C++ is a compiled language, that 
is, programs are written in a human-readable script and this script is 
then provided to another program called a compiler which generates a 
machine-readable numeric code that can be loaded into, and directly 
executed by, a computer. As described below, the C++ language has certain 
characteristics which allow a software developer to easily use programs 
written by others while still providing a great deal of control over the 
reuse of programs to prevent their destruction or improper use. The C++ 
language is well-known and many articles and texts are available which 
describe the language in detail. In addition, C++ compilers are 
commercially available from several vendors including Borland 
International, Inc. and Microsoft Corporation. Accordingly, for reasons of 
clarity, the details of the C++ language and the operation of the C++ 
compiler will not be discussed further in detail herein. 
As will be understood by those skilled in the art, Object-Oriented 
Programming (OOP) techniques involve the definition, creation, use and 
destruction of "objects". These objects are software entities comprising 
data elements, or attributes, and methods, or functions, which manipulate 
the data elements. The attributes and related methods are treated by the 
software as an entity and can be created, used and deleted as if they were 
a single item. Together, the attributes and methods enable objects to 
model virtually any real-world entity in terms of its characteristics, 
which can be represented by the data elements, and its behavior, which can 
be represented by its data manipulation functions. In this way, objects 
can model concrete things like people and computers, and they can also 
model abstract concepts like numbers or geometrical designs. 
Objects are defined by creating "classes" which are not objects themselves, 
but which act as templates that instruct the compiler how to construct the 
actual object. A class may, for example, specify the number and type of 
data variables and the steps involved in the methods which manipulate the 
data. When an object-oriented program is compiled, the class code is 
compiled into the program, but no objects exist. Therefore, none of the 
variables or data structures in the compiled program exist or have any 
memory allotted to them. An object is actually created by the program at 
runtime by means of a special function called a constructor which uses the 
corresponding class definition and additional information, such as 
arguments provided during object creation, to construct the object. 
Likewise objects are destroyed by a special function called a destructor. 
Objects may be used by using their data and invoking their functions. When 
an object is created at runtime memory is allotted and data structures are 
created. 
The principle benefits of object-oriented programming techniques arise out 
of three basic principles; encapsulation, polymorphism and inheritance. 
More specifically, objects can be designed to hide, or encapsulate, all, 
or a portion of, the internal data structure and the internal functions. 
More particularly, during program design, a program developer can define 
objects in which all or some of the attributes and all or some of the 
related functions are considered "private" or for use only by the object 
itself. Other data or functions can be declared "public" or available for 
use by other programs. Access to the private variables by other programs 
can be controlled by defining public functions for an object which access 
the object's private data. The public functions form a controlled and 
consistent interface between the private data and the "outside" world. Any 
attempt to write program code which directly accesses the private 
variables causes the compiler to generate an error during program 
compilation which error stops the compilation process and prevents the 
program from being run. 
Polymorphism is a concept which allows objects and functions which have the 
same overall format, but which work with different data, to function 
differently in order to produce consistent results. For example, an 
addition function may be defined as variable A plus variable B (A+B) and 
this same format can be used whether the A and B are numbers, characters 
or dollars and cents. However, the actual program code which performs the 
addition may differ widely depending on the type of variables that 
comprise A and B. Polymorphism allows three separate function definitions 
to be written, one for each type of variable (numbers, characters and 
dollars). After the functions have been defined, a program can later refer 
to the addition function by its common format (A+B) and, at runtime, the 
program will determine which of the three functions is actually called by 
examining the variable types. Polymorphism allows similar functions which 
produce analogous results to be "grouped" in the program source code to 
produce a more logical and clear program flow. 
The third principle which underlies object-oriented programming is 
inheritance, which allows program developers to easily reuse pre-existing 
programs and to avoid creating software from scratch. The principle of 
inheritance allows a software developer to declare classes (and the 
objects which are later created from them) as related. Specifically, 
classes may be designated as subclasses of other base classes. A subclass 
"inherits" and has access to all of the public functions of its base 
classes just as if these function appeared in the subclass. Alternatively, 
a subclass can override some or all of its inherited functions or may 
modify some or all of its inherited functions merely by defining a new 
function with the same form (overriding or modification does not alter the 
function in the base class, but merely modifies the use of the function in 
the subclass). The creation of a new subclass which has some of the 
functionality (with selective modification) of another class allows 
software developers to easily customize existing code to meet their 
particular needs. 
Object-oriented technology forms the basis for component system 200 of the 
present invention. For the purpose of the illustrative embodiment, 
components are essentially C++ objects that conform to an object model, 
such as Microsoft's Component Object Model. An object module is a unifying 
set of rules that describe object structure, object life cycle, and 
inter-object communication. Object structure relates to the physical 
layout of objects in memory, while object life cycle refers to how 
applications create and destroy objects. Inter-object communication refers 
to protocols by which objects communicate with one another. Object modules 
are useful in contexts where all objects in a given system need to conform 
to a given protocol governing these parameters. Most object-oriented and 
object-based languages, including the C++ programming language, do not 
specify true object modules, but merely specify syntax and semantics of a 
basic object implementation without specifying the rules that unify object 
systems. 
Component system 200 of the present invention will be described by way of 
example as being implemented using Microsoft's Component Object Model 
(COM) and Object Linking and Embedding (OLE) standards. Other object 
models, however, such as IBM Corporation's System Object Model (SOM) and 
Distributed System Object Model (DSOM), may be utilized for implementing 
the inventive component system described herein. MicroSoft has published a 
COM specification which defines a set of rules intended to unify all 
objects in a given software system and which further identifies and 
defines a number of standard interfaces, e.g. publicly available 
protocols, that have been found to be universally applicable to the 
development of object-oriented software. For example, COM specifies the 
interfaces for object creation, persistence, event notification, visual 
rendering, etc. The actual implementation of the interfaces as defined by 
the COM specification, is left to the software developer. 
When an object conforms to the COM specification, the object behaves 
functionally as described by the COM interface. Generally, an object which 
implements the COM interface is referred to as a server, while 
applications and other objects that use these interfaces are referred to 
as clients. Accordingly, through interfaces, the COM specification defines 
a simple client/server module. 
Microsoft Corporation has also published an Object Linking and Embedding 
(OLE) 2.0 specification which defines the rules regarding linking and 
embedding of object which conform to the COM specification. OLE is a set 
of system-level services which utilize the interfaces defined by the COM 
specification. These services are implemented as a series of OLE libraries 
in the form of Dynamic Link Libraries (DLLs) that come with the 
Microsoft's Windows operating system and supply built-in services that do 
generalized, low-level tasks. One of the mechanisms defined by OLE 
specification is referred to as an OLE control (OCX). Controls are 
autonomous software building blocks which embody all other OLE 
technologies. OLE controls are implemented as in-process servers, i.e. 
dynamic link libraries, which implement extra interfaces required to 
handle such functions as automation, inside/outside activation, events, 
properties and change notifications. 
OLE controls operate within the context of applications referred to as 
containers. A container is a stand-alone application capable of embedding 
OLE controls. As a result, containers themselves implement a set of 
interfaces to deal with items such as a tool bar, menu and status bar 
negotiation, events, properties, control placement and sizing, etc. 
Having defined the object-oriented technology and exemplary specifications, 
including the COM specification and the OLE specification, with which the 
inventive component system may be designed, the component system itself 
will be described with reference to component structure, and elements of 
the component system. 
Component System 
FIG. 2 illustrates conceptually the inventive component system 200 and 
various elements of operating system 215 which interact with the component 
system 200, but are not considered part of the component system 200. 
Specifically, component system 200 comprises one or more base OLE controls 
230, referred to hereinafter as "components" or "base component", a 
template builder 204, a template installer executable 210, a component 
loader 206, a template storage DLL 205, a template storage 212, and, 
optionally, a distribution pack 208. The elements of the operating system 
which interact with component system 200 include an OLE container 220, OLE 
libraries 230, application program interfaces (APIs) 240 which may 
comprise WIN 32 API designed by Microsoft Corp., and the operating system 
registry 250. 
In the illustrative embodiment, operating system 215 comprises the Windows 
95 or Windows NT operating system, both available from MicroSoft 
Corporation, Redmond, Wash. Container 220 may comprise any stand alone 
application capable of embedding OLE controls. A container 220 interacts 
with the WIN32 APIs 240 through the OLE libraries 230 in order to insert 
OLE objects or controls into the operating system registry 250. Examples 
of OLE containers are Lotus Notes available from Lotus Development 
Corporation, Cambridge, Mass., and MicroSoft Word, available from 
MicroSoft Corporation, Redmond, Wash. OLE libraries 230 comprise the set 
of system-level services in accordance with the OLE specification 2.0. The 
OLE libraries function to call the WIN32 APIs 240 to locate registered 
objects in registry 250 and to insert and create object dialog and return 
results to callers. When creating an OLE object or an OLE control, OLE 
libraries 230 call the WIN32 APIs 240 to read the registry 250 and to find 
out the server for an object or a control. The OLE libraries 230 further 
cause the server to be loaded and to cause the ICLASSFACTORY interface to 
be called to create the instance of an OLE control. 
Registry 250 comprises a file in memory, typically on disk, containing 
information registered about various programs and objects. The system 
registry 250 is organized into "hives" and structured hierarchically. A 
hive is a discrete body of root level keys, subkeys, and values that is 
rooted at the top of the registry hierarchy. A hive is backed by a single 
file and LOG file. In the illustrative embodiment, hives are portions of 
the Windows registry that contain a subtree of registry entries. There are 
five hives: HKEY.sub.-- LOCAL.sub.-- MACHINE, HKEY.sub.--