Click here to Skip to main content
13,248,107 members (36,888 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 17 Oct 2011

Multi-Language Programming : Entity Object Inheritance And Function Overloading_3

, 17 Oct 2011
Rate this:
Please Sign up or sign in to vote.
Multi-Language Programming : Entity Object Inheritance and Function Overloading

For multi-language programming based on common object environment, object is defined by different languages. Therefore, traditional object-oriented programming method is no longer suitable for this case. Developers cannot create an instance of a class defined in other language. For example, if a class is defined in Java, a C++ instance of it cannot be created.

Interface objects managed in common object environment are entity objects rather than abstract definition of specific languages. They exist in memory of application. Object-oriented concept is very meaningful. It can simplify software development and maintenance. Is there a way to introduce the concept of object-oriented to these entity objects? How to handle entity objects inheritance and function overloading?

Based on the support of the environment, developers can create instances of an entity object (interface object). Example is as follows:

From the above figure, we can see that entity objects can also act as class objects. They may have instances of other languages based on the support of common object environment. The instances can also define new attributes, new functions, or overloading functions defined in its class objects. Environment provides functions for application to access attributes or call functions of instances.

Attributes of objects may be defined by class object of other languages. The environment should provide functions for each language supported to access these attributes and perform parameter conversion. For examples, if class object of Java defines an attribute Para1, its C/C++ instance will inherit the attribute Para1. Both languages can access Para1, which is shown below:

Calling object functions is similar to accessing their attributes, common object environment supports to direct the call to correct entity object. For example, if a function “Add” is defined for Java class object, calling the function of a C/C++ instance of it should be redirected to Java language, which is shown below:

Function of class object may be overloading. In this case, calling of base function should be redirected to the overloading function. Common object environment will assist in the completion of the calling.

Traditional object-oriented method is supported by the compiler and language syntax. For entity objects in common object environment, because objects may be created and their functions may be defined by different languages, the language syntax and compiler can no longer support. To solve this problem, entity class objects are introduced and the environment runtime supports their inheritance and functions calling and overloading.

Further calling methods of objects that belong to different languages will be discussed later.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

China China
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 17 Oct 2011
Article Copyright 2011 by li9705
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid