Multi-Language Programming : Entity Object Inheritance And Function Overloading_3

     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 can not create instance of a class defined in other language. For example, if a class is defined in java, a c++ instance of it can not 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 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 objects 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 belong to different languages will be discussed later.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值