Teach yourself corba 14 days ebook




















NetLibrary Click to view electronic book. Please choose whether or not you want other users to be able to see on your profile that this library is a favorite of yours. Finding libraries that hold this item You may have already requested this item. Please select Ok if you would like to proceed with this request anyway. WorldCat is the world's largest library catalog, helping you find library materials online.

Don't have an account? You can easily create a free account. Your Web browser is not enabled for JavaScript. Some features of WorldCat will not be available. Create lists, bibliographies and reviews: or. Search WorldCat Find items in libraries near you. Advanced Search Find a Library. I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time. Pearson Education, Inc.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies. To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:. For inquiries and questions, we collect the inquiry or question, together with name, contact details email address, phone number and mailing address and any other additional information voluntarily submitted to us through a Contact Us form or an email.

We use this information to address the inquiry and respond to the question. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes. Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law. If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information informit.

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature. We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Thus, the approach is often referred to as the tie mechanism or tying. Most IDL compilers accept command-line arguments to determine which implementation approach to generate code for. Therefore, before you use the IDL compiler to generate code from your IDL definitions, you'll want to determine the approach you want to use. Consult your IDL compiler's documentation to determine which command-line arguments, if any, the IDL compiler expects.

Implementation by inheritance. Implementation by delegation. How to Choose an Implmentation Approach One question you might be asking by now is how to choose an implementation approach. In many cases, this is probably a matter of taste. However, there are certain cases that work well with a particular approach. For example, recall that in the inheritance approach, the implementation class derives from a class provided by the IDL compiler.

If an application makes use of legacy code to implement an interface, it might not be practical to change the classes in that legacy code to inherit from a class generated by the IDL compiler. Therefore, for such an application it would make more sense to use the delegation approach; existing classes can readily be transformed into tie classes.

Warning: After you've chosen an implementation approach and have written a great deal of code, be prepared to stick with that approach for that server. Although it's possible to change from one implementation approach to another, this is a very tedious process if a lot of code has already been written.

This issue doesn't present itself very often, but you should be aware of it. For the purposes of this example, either implementation approach will do. The example will use the delegation approach; implementing the server using inheritance will be left as an exercise. Note that you can usually mix and match the implementation and delegation approaches within a single server application.

Although you'll use only one approach per interface, you could choose different approaches for different interfaces in the system. For example, if you had decided that the inheritance approach was the best match for your needs, but you had a few legacy classes that mandated the use of the tie approach, you could use that approach for those classes while using the inheritance approach for the remainder.

Using the IDL Compiler Now that you have defined your system's object interfaces in IDL and have decided on an implementation approach, you're ready to compile the IDL file or files, in a more complex system. Note: The method and command-line arguments for invoking the IDL compiler vary across platforms and products. Consult your product documentation for specific instructions on using your IDL compiler.

Recall that this example will use the delegation approach--also called the tie mechanism--so be sure to consult your IDL compiler documentation for the appropriate command-line arguments if any are required to generate the proper files and source code. In this case, the IDL compiler is named idltojava. The -fno-cpp switch instructs the IDL compiler to not invoke the C preprocessor before compiling the file.

The -fclient and -fserver switches instruct the IDL compiler to generate client stubs and server skeletons, respectively. For now, you could get by without the -fclient switch because you'll only be implementing the server, but because you'll want the client stubs later, it will save time to generate them now. Here, the IDL compiler, named orbeline , generates client stubs and server skeletons for the StockMarket. The -c cpp switch instructs the compiler to use the.

You can, of course, substitute your favorite filename extensions in place of these. Tip: As with any utility run from the command line, before you can run the IDL compiler, you might have to set the PATH variable in your system's environment to include the directory where the IDL compiler resides.

Client Stubs and Server Skeletons When the IDL compiler is invoked, it generates code that conforms to the language mapping used by that particular product. The IDL compiler will generate a number of files--some of them helper classes, some of them client stub classes, and some of them server skeleton classes. Note: Recall from Day 2 that client stubs for an interface are pieces of code compiled with client applications that use that interface.

These stubs do nothing more than tell the client's ORB to marshal and unmarshal outgoing and incoming parameters. Similarly, server skeletons are snippets of code that create the server framework.

These skeletons pass incoming parameters to the implementation code--written by you, the developer--and pass outgoing parameters back to the client.

The names of the files generated by the IDL compiler are dependent on the language mapping used and sometimes on command-line arguments passed to the IDL compiler.

For example, some IDL compilers accept switches that specify prefixes and suffixes to be added to the class names. The contents of these files will remain the same, for the most part, regardless of the IDL compiler used assuming the products conform to the standard language mappings. Similarly, the corresponding Java products will output nearly the same source code.

Note: Strictly speaking, the term "IDL compiler" is a misnomer. Implementing the Server Interfaces After you have successfully used the IDL compiler to generate server skeletons and client stubs for your application, you are ready to implement the server interfaces.

The IDL compiler generates a number of files; for each IDL interface , the compiler will generate a source file and header file for the client stub and a source file and header file for the server skeleton, resulting in four files per interface.

Additionally, the IDL compiler can create separate directories for IDL module s; it can also create additional files for helper classes. Also, most IDL compilers allow you to specify the suffix to use for client stubs and server skeletons. Refer to your IDL compiler's documentation to determine what files it produces, what filenames it uses, and how to change the default filename suffixes. To keep the example as simple as possible, Java is used as the implementation language.

Java was chosen for this example because of its relative simplicity, particularly when developing CORBA applications. Of all the languages commonly used for CORBA application development, Java probably gets in the way of the developer the least, making it the best suited for an introductory example. Using Server Skeletons The server skeleton, as you have learned, provides a framework upon which to build the server implementation. You, the developer, provide the implementation for these methods.

In the case of Java, a server skeleton combines a set of helper classes with an interface, for which you, again, provide the implementation. Assuming you use Sun's Java IDL compiler to produce the server skeletons for your application, you will see that the compiler produced a directory called StockMarket corresponding to the name of the IDL module defined in StockMarket.

Within this directory are a number of files containing client stub and server skeleton definitions:. At this point, your only concern is with the server skeleton portion of these files. In particular, note that the Java interface describing the StockServer services is contained in the StockServer. Its contents appear in Listing 4. The StockServerImplBase. Furthermore, you can see that this interface extends the org. The entire marshaling process takes place without any programmer intervention whatsoever.

A client application simply invokes the desired remote method--which has the appearance of being a local method, as far as the client is concerned--and a result is returned or an exception is raised , again, just as would happen with a local method.

The entire process of marshaling input parameters, initiating the method invocation on the server, and unmarshaling the return parameters is performed automatically and transparently by the ORB. This means that a client running on, for instance, a Macintosh system can invoke methods on a server running on a UNIX system.

In addition to independence of operating system used, differences in hardware such as processor byte ordering, or endianness are also rendered irrelevant because the ORB automatically makes these conversions as necessary. In essence, any differences in platforms--be it operating system, endianness, word size, and so on--are accounted for by the ORB.

Note again that the process of marshaling and unmarshaling parameters is handled completely by the ORB, entirely transparent to both the client and server. Because the entire process is handled by the ORB, the developer need not concern himself with the details of the mechanism by which the parameters are marshaled and unmarshaled. To summarize the purpose of the ORB, its responsibilities are as follows: G Given an object reference from a client, the ORB locates the corresponding object implementation the server on behalf of the client.

Note that it is the responsibility of the client to obtain an object reference in the first place, through a process you'll learn later. When the server is located, the ORB ensures that the server is ready to receive the request. The ORB on the client side accepts the parameters of the method being invoked and marshals see the next section the parameters to the network.

The ORB on the server side unmarshals again, see the next section the parameters from the network and delivers them to the server. The major benefit offered by the ORB is its platform-independent treatment of data; parameters can be converted on-the-fly between varying machine formats as they are marshaled and unmarshaled.

IDL, as its name suggests, is the language used to define interfaces between application components. Note that IDL is not a procedural language; it can define only interfaces, not implementations. Java programmers might liken IDL definitions to definitions of Java interfaces; again, only the interface is described--no implementation is provided. It is covered in great detail on Day 3. The IDL specification is responsible for ensuring that data is properly exchanged between dissimilar languages.

It is the responsibility of the IDL specification--and the IDL compilers that implement it--to define such data types in a language-independent way. IDL will be covered in great detail in the next chapter. After that, you will use IDL to--what else? It achieves this language independence through the concept of a language mapping.

Mappings for other languages exist as well; these mappings are either nonstandard or are in the process of being standardized by the OMG. New Term: A language mapping is a specification that maps IDL language constructs to the constructs of a particular programming language. Because CORBA does not dictate a particular language to use, it gives application developers the freedom to choose the language that best suits the needs of their applications.

Taking this freedom one step further, developers. For instance, the client components of an application might be implemented in Java, which ensures that the clients can run on virtually any type of machine. CORBA makes possible the communication between these various components. Typically, a computer network consists of systems that are physically connected although the advent of wireless network technology might force us to revise our understanding of what "physically connected" means.

This physical layer provides the medium through which communication can take place, whether that medium is a telephone line, a fiber-optic cable, a satellite uplink, or any combination of networking technologies. Somewhere above the physical layer lies the transport layer, which involves protocols responsible for moving packets of data from one point to another.

Additionally, vendors can and do define and use proprietary protocols for communication between CORBA components. Because GIOP is a generalized protocol, it is not used directly; instead, it is specialized by a particular protocol that would then be used directly. As of the 2. Some vendors have gone so far as to adopt IIOP as their products' native protocol the protocol used by default rather than use a proprietary protocol; however, an ORB is allowed to support any number of protocols, as long as IIOP is supported when communicating with each other, ORBs can negotiate which protocol to use.

CORBA applications aren't limited to using only one of these protocols; an application architecture can be designed to use a bridge that would interconnect, for instance, DCE-based application components with IIOP-based ones. You can see, then, that rather than supplant network transport protocols, the CORBA architecture creates another layer--the inter-ORB protocol layer--which uses the underlying transport layer as its foundation.

You will now explore these concepts in greater depth. Object Distribution To a CORBA client, a remote method call looks exactly like a local method call, thanks to the use of client stubs a concept you'll explore later in this chapter. Thus, the distributed nature of CORBA objects is transparent to the users of those objects; the clients are unaware that they are actually dealing with objects which are distributed on a network.

Actually, the preceding statement is almost true. Because object distribution brings with it more potential for failure due to a network outage, server crash, and so on , CORBA must offer a contingency to handle such possibilities. It does so by offering a set of system exceptions, which can be raised by any remote method. You'll learn about exceptions more in later chapters--on Day 3, you'll see how exceptions are declared in IDL; on Day 7, you'll add exception handling to a sample application.

Thus, with the exception--pun intended--of this additional exception raised by CORBA object methods, a remote method is otherwise identical to its local counterpart. Object References In a distributed application, there are two possible methods for one application component to obtain access to an object in another process. One method is known as passing by reference, illustrated in Figure 2.

In this method, the first process, Process A, passes an object reference to the second process, Process B. When Process B invokes a method on that object, the method is executed by Process A because that process owns the object. The object exists in the memory and process space of Process A. Process B only has visibility to the object through the object reference , and thus can only request that Process A execute methods on Process B's behalf.

Passing an object by reference means that a process grants visibility of one of its objects to another process while retaining ownership of that object. New Term: When an object is passed by reference, the object itself remains "in place" while an object reference for that object is passed. Operations on the object through the object reference are actually processed by the object itself. Passing an object by reference. The second method of passing an object between application components is known as passing by value and is depicted in Figure 2.

In this method, the actual state of the object such as the values of its member variables is passed to the requesting component typically through a process known as serialization. When methods of the object are invoked by Process B, they are executed by Process B instead of Process A, where the original object resides. Furthermore, because the object is passed by value, the state of the original object is not changed; only the copy now owned by Process B is modified.

Generally, it is the responsibility of the developer to write the code that serializes and deserializes objects although this capability is built into some languages, such as Java. New Term: When an object is passed by value, the object's state is copied and passed to its destination, where a new copy of the object is instantiated. Operations on that object's copy are processed by the copy, not by the original object.

Serialization refers to the encoding of an object's state into a stream, such as a disk file or network connection. When an object is serialized, it can be written to such a stream and subsequently read and deserialized, a process that converts the serialized data containing the object's state back into an instance of the object.

Passing an object by value. In order to facilitate passing objects by value in a distributed application, in addition to passing the state of the object across the network, it is also necessary to ensure that the. This is not necessary when objects are passed by reference; recall that method invocations are executed by the component that owns the actual object. When the CORBA pass-by-value capability is specified, it will need to address these issues; readers should stay tuned to OMG announcements for updates on this development.

There are a few issues associated with passing objects by reference only. Remember that when passing by reference is the only option, methods invoked on an object are always executed by the component that owns that object in other words, the component that has created that object ; an object cannot migrate from one application component to another.

However, you can devise methods that simulate this behavior; it simply is not provided by the CORBA architecture itself at this time. This also means that all method calls are remote method calls unless both the calling object and called object are owned by the same application component. Obviously, if a component invokes a lengthy series of method calls on a remote object, a great deal of overhead can be consumed by the communication between the two components. For this reason, it might be more efficient to pass an object by value so the component using that object can manipulate it locally.

On Day 10 you'll explore this issue in greater detail, but in the meantime, readers should be aware that CORBA's current lack of pass-by-value semantics does raise this issue.

The OMG recommends that new object adapter types be created only when necessary and provides three sample object adapters: the Basic Object Adapter BOA , which you will concentrate on, and the Library Object Adapter and Object-Oriented Database Adapter, both of which are useful for accessing objects in persistent storage.

Again, you will concern yourself only with the Basic Object Adapter, by far the most commonly used object adapter. These functions range from user authentication to object activation to object persistence. Server Activation Policies One particularly important and useful feature of the BOA is its object activation and deactivation capability. The BOA supports four types of activation policies, which indicate how application components are to be initialized.

These activation policies include the following: G The shared server policy, in which a single server which in this context usually means a process running on a machine is shared between multiple objects G The unshared server policy, in which a server contains only one object G The server-per-method policy, which automatically starts a server when an object method is invoked and exits the server when the method returns.

The persistent server policy, in which the server is started manually by a user, batch job, system daemon, or some other external agent. New Term: A server activation policy indicates how that particular server is intended to be accessed; for example, if there is a single server used by all clients, or a new instance of the server should be started for each client, and so on.

This variety of activation policies allows an application architect to choose the type of behavior that makes the most sense for a particular type of server. For instance, a server requiring a length of time to initialize itself might work best as a persistent server, because the necessary initialization time would adversely affect the response time for that server.

On the other hand, a server that starts up quickly upon demand might work well with the server-per-method policy. Note:It is worth noting here that the term persistent server has nothing to do with the common use of the term persistent, which refers to the capability of an object to store its state in some sort of nonvolatile storage facility such as a database of disk files.

A persistent server does not necessarily store its state in persistent storage although it could ; in this case, the term merely implies that the server runs persistently or, in other words, continuously.

A client is a component that consumes services provided by a server or servers. The architecture of a CORBA application is no different; generally, certain components of an application provide services that are used by other components of the application. Not surprisingly, the general terms client and server refer to these components of a CORBA application.

When considering a single remote method invocation, however, the roles of client and server can be temporarily reversed because a CORBA object can participate in multiple interactions simultaneously.

In a CORBA application, any component that provides an implementation for an object is considered a server, at least where that object is concerned. If a component creates an object and provides other components with visibility to that object in other words, allows other components to obtain references to that object , that component acts as a server for that object; any requests made on that object by other components will be processed by the component that created the object.

Being a CORBA server means that the component the server executes methods for a particular object on behalf of other components the clients. Multiple Personalities? Being Both a Client and a Server Frequently, an application component can provide services to other application components while accessing services from other components.

In this case, the component is acting as a client of one component and as a server to the other components see Figure 2. In fact, two components can simultaneously act as clients and servers to each other.

To understand this situation, consider the following scenario illustrated in Figure 2. Here, Component A acts as a client and Component B acts as a server. Now assume that as a parameter of the method called, Component A passes a reference to an object that it has created and thus provides an implementation for the object. Assume further that Component B now calls some method on that object.

For this particular method invocation, Component A acts as a server, whereas Component B acts as a client. The two components have not changed their overall roles in the application, but they have temporarily reversed their roles as client and server.

Therefore, from this example you see that in a CORBA application, the terms client and server might depend on the context of the method being called and in which component that method's object resides.

Acting as a client and a server. One last point to consider in the terminology of clients and servers: Although an application component can function as both a client and a server, it is nevertheless typical to label such a component as one or the other not both. In the preceding example, assume that for the most part, Component A calls methods on objects owned by Component B. As illustrated in the example, some or even all of these method calls can pass object references to Component B, which can then make calls through those object references back to Component A.

Although Component A is acting as a server for these method calls, because the overall function of the component is to use services provided by Component B, and only provides objects as arguments to methods in Component B, you might very well refer to Component A as the client and to Component B as the server.

Methods called in this way are generally referred to as client callback methods, or simply callbacks. Callbacks are especially important given CORBA's current lack of pass-by-value capability; the capability to pass objects by value, when it becomes available, will eliminate the need for many callbacks.

New Term: Client callback method, or simply callback, is a generic term given to a method that is implemented by a client and called by a server. Callbacks essentially make a client Figure 2. A client callback method. The IDL compiler generates what are known as client stubs and server skeletons. Client stubs and server skeletons serve as a sort of "glue" that connects language-independent IDL interface specifications to language-specific implementation code.

Client stubs for each interface are provided for inclusion with clients that use those interfaces. The client stub for a particular interface provides a dummy implementation for each of the methods in that interface.

Rather than execute the server functionality, however, the client stub methods simply communicate with the ORB to marshal and unmarshal parameters. A server skeleton, also generated by the IDL compiler, is a piece of code that provides the "framework" on which the server implementation code for a particular interface is built.

On the other side, you have server skeletons, providing the framework upon which the server is built. For each method of an interface, the IDL compiler generates an empty method in the server skeleton.

The developer then provides an implementation for each of these methods. Client stubs and server skeletons. Rather than being statically linked to server interfaces, such clients can discover server interfaces dynamically and use services not even conceived of at the time the clients were built. However, using the DII significantly increases the complexity of a client application and is probably best left for a certain niche of applications.

Because the Dynamic Invocation Interface is considered an advanced topic, you won't be seeing any more of it until Day These capabilities include event management, licensing, object persistence, naming, security, transactions, user interface management, data interchange, and much more. The interfaces for using these capabilities are standardized by the OMG, meaning that their usage is or will be consistent across platforms and products.

For the time being, you should be aware that there is a difference between what services and facilities are specified by the OMG and what services and facilities are available in various CORBA products. Before deciding to use a particular service or facility in an application design, you should first ensure that a product actually exists that implements that functionality.

You defined the terms client and server in the context of CORBA and saw that a single application component can simultaneously act as both a client and a server. A In many cases, a client might only need to pass a simple object to a server method. Because objects cannot be passed by value, the server must use callbacks to the client to manipulate the object even if it only wants to read the object's state.

If the object can be passed by value, the server can operate on a local copy of the object, eliminating the need for client callbacks. Of course, in some cases the client will want to retain ownership of the object and will want the server to make callbacks; in such cases, the callback paradigm would be retained. A For an overwhelming majority of applications, if you think DII is necessary, you might want to reconsider. Due to the complexity and overhead of using DII, it is almost always best to avoid it.

See Chapter 11 for more information on when the use of DII might be appropriate. A Because CORBA object interfaces are specified in IDL, which is independent of any implementation language, it is necessary to specify a methodology for converting IDL data types to data types of the implementation language s chosen.

The language mapping for a particular implementation language describes this methodology. Furthermore, language mappings for many common languages are standardized, meaning that an application written to use one CORBA product can be made to work with a different product with little or no modification as long as the application uses only features of the standard language mapping.

On most days, a few exercises will accompany the quiz; today, because no real "working knowledge" material was presented, there are no exercises. Earlier in the chapter, you claimed that the capability to pass objects by value, when it becomes available, will eliminate the need for many callbacks. Why is this true? The first component has a single method that simply returns the time of day.

The second component, when initialized, performs a lengthy calculation on a large database table; it features a single method that returns the precalculated result. Which server activation policies will the architect want to use for these two components, and why?

Today you'll explore the various constructs of IDL and learn their uses. You'll start with the primitive data types, such as Booleans, floating point types, integer types, and characters and character strings, which you will find similar to data types found in most programming languages. You'll then move on to constructed types--the enumerated type, the structure type, the union type, and the interface type--which are simply types constructed from other types.

Finally, you'll learn about advanced types, such as container types sequences and arrays , exceptions, and others. By the end of the chapter you'll have covered virtually all there is to know about IDL. In particular, IDL has rules regarding case sensitivity, definition syntax, comment syntax, and C preprocessor usage.

Besides these identifiers being case sensitive, IDL imposes another restriction: The names of identifiers in the same scope for instance, two interfaces in the same module or two operations in the same interface cannot differ in case only. Obviously, you haven't yet been exposed to modules, interfaces, and operations; stay tuned to this chapter for more details on these constructs.

Note:What the OMG refers to as operations, you might know as methods, member functions, or even messages. Whatever name you know it by, an operation defines a particular behavior of an interface, including the input and output parameters of that particular behavior.

Throughout this book, the terms operation and method will be used interchangeably, because they refer to exactly the same concept. When a closing brace also appears at the end of a definition, it is also followed by a semicolon. An example of this syntax appears in Listing 3. Note that the second comment in the listing contains embedded comment characters; these are for description purposes only and are not actually allowed by IDL.

Listing 3. IDL comments. This is a C-style comment. Use of the C Preprocessor IDL assumes the existence of a C preprocessor to process constructs such as macro definitions and conditional compilation.

If the IDL you write does not make use of these features, you can do without a C preprocessor, but you should recognize that IDL can make use of C preprocessor features.

The Java language does not use a preprocessor. The preprocessor, among other things, resolves macros, processes directives such as ifdef The module construct is used to group together IDL definitions that share a common purpose. The use of the module construct is simple: A module declaration specifies the module name and encloses its members in braces, as illustrated in Listing 3. New Term: The grouping together of similar interfaces, constant values, and the like is commonly referred to as partitioning and is a typical step in the system design process particularly in more complex systems.

Partitions are also often referred to as modules which should be no surprise or as packages in fact, the IDL module concept closely resembles the Java package concept--or the other way around, because IDL came first. Module example. The examples get ahead of themselves somewhat by using the interface construct here; interfaces are described later in this chapter. Coupling and Cohesion New Term: So, now that you have the ability to group interfaces together, how do you decide which interfaces to group together?

This is really a question of system design and would be best answered in a text dedicated to that subject. There are plenty of excellent books available on the subject of object-oriented analysis and design. However, an overall guideline is that a good design generally exhibits two attributes: loose coupling and tight cohesion. The first means that components in separate modules are not tightly integrated with each other; an application using components in one module generally need not know about components in another module.

Of course, there is often some overlap between modules for various reasons, such as the need to share data between modules or to facilitate common functionality between modules. When there is little or no dependency between components, they are said to be loosely coupled.

On the other hand, within a single module it is advantageous for a design to achieve tight cohesion. This means that interfaces within the module are tightly integrated with each other. It is difficult to describe the purpose of one of these components without referring to the others; hence, one might say that the components are tightly cohesive. Figure 3. The figure also illustrates the advantage of loose coupling between modules: Imagine if, when you installed a new CD player in your car, you had to change the spark plugs and replace your timing chain!

Loose coupling of components reduces the possibility that changes to one component will require changes to another. Coupling and cohesion. Primitive Types Like most programming languages, IDL features a variety of primitive types which can then be combined into aggregate types. These types store simple values such as integral numbers, floating point numbers, character strings, and so on.

It is pointless to have a variable of type void, but the type is useful for methods that don't return any value. IDL defines two boolean constants, true and false, which have obvious meanings. As expected, it maps directly to the char type in these languages. The char data type is an 8-bit quantity.

Floating Point Types IDL defines a number of types to represent floating point values; these are already familiar to most developers. Not surprisingly, it corresponds to the familiar double type of a number of languages. Integer Types IDL also defines a number of integral numeric types. Again, most developers will recognize these.

Unlike most familiar programming languages, though, IDL doesn't define a plain int type, only short and long integer types.

The IDL long type represents a bit signed quantity with a range of Its range is Java, of course, has the byte type, which is similar. C has no direct counterpart because there is no "true" string type in C ; character arrays are used instead. IDL supports both fixed- and variable-length strings. The scope of a const value, like any value, is that of its enclosing interface or module.

Constructed Types Constructed types, which combine other types, enable the creation of user-defined types. Perhaps the most useful of these constructs is the interface, which defines the services provided by your application objects.



0コメント

  • 1000 / 1000