您的位置:首页 > 移动开发 > Objective-C

Mixed-Language Programming : How To Manage Objects(2)

2011-10-12 20:44 316 查看
For multi language programming of c/c++, python, java, csharp, etc, the blog introduces a common and simplified method, which uses common object environment to manage interface object of different languages. The document discusses on how to manage these
objects further.

Interface objects may belong to different languages or different components or libraries. An application or product may also depend on multiple components or libraries of same or different languages. We can group interface objects of a component together
as a service, and application is regards as a service too. Then, common object environment is made up of one or more services. An application with services depended on is called service group. Using a figure to illustrate is as follows:



Interface objects managed by common object environment have attributes and functions. For application to get/set object’s attributes or call object’s functions, first, it should find object defined in other services through function presented by common object
environment. Then, it calls object’s functions, and the environment is responsible for translating input and output arguments. Detailed method will be discussed later.



Service of different languages based on common object environment may be packed and published as a component or library. The component has significant advantages. It can be called by any other languages supported by environment. Therefore, the components
or libraries are common. For example, the component written by java will be used in c/c++, java, c#, python, etc, without any change needed.

Because there is a common object environment managing services and objects, developer can publish their components on websites. If application or product needs the component, common object environment is responsible for downloading from website and loading
it in application memory. For existing development result, kinds of source code, or libraries, they can be added function support for common object environment easily and becomes common components. These will reduce duplication of code developments and improve
efficiency greatly. Developers no longer need to rewrite and test their components for new languages.

There may be a large number of objects for a service. For further managing these objects, we can also sort objects into different groups. These groups are called service item which it is only a name and nor more meaning.

Conclusion: for convenient, common object environment uses framework of service group, service, service item, and objects to manage interface objects in environment. The service can be packed and published as common components or libraries which
have more advantages.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: