分享
 
 
 

Conception of Programmable Application

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

W

hat is the Programmable Application

Programmable Application is an application that has a built-in script mechanism with which users can type in their commands to implement functionalities provided by the application.

In our daily life, we can often see this kind of application. Just take the Microsoft Word as an example, when we click Start->Programs, get into the Microsoft Office group, and then start the Word, we can type anything we want there, further more, we can record a macro, run a macro or even open the Visual Basic editor anytime and anywhere we want. We can say Word is a Programmable Application and the Visual Basic (actually it is the Visual Basic for Application) here is a built-in script for this application. One thing needs to be explained here is that, Visual Basic for Application is not only a built-in script for Word, but also other software in Microsoft Office.

Why we should make our application programmable

Generally speaking, we make our application programmable just for the new features and advantages, which were provided by this new application architecture. These features and advantages include:

a. Flexibility

Flexibility is the first and the most important feature that was provided by the programmability. As we know, most application is made up of several modules. These modules provide specialized functionality and fit together to implement the business logic of the whole application. For example, a student management system can consist of student registration module, course management module, score management module, student information management and so on. Following figure illustrates the structure of these applications.

Application

Module 1

Module 2

Module 3

Figure 2.a.1 Common Application Structure

This kind of application can meet most users’ requirements, but maybe some users have their own special requirement, for example, in student management system, some users do not need the student information management, but they want the certification management to be integrated into the system. In common application structure, we can neither add a module to the system, nor remove a module from the system, so we say that the common application structure doesn’t have the flexibility.

To make the application flexible, we can use the plug-in technology. This kind of technology is mainly implemented by using the Dynamic Link Library (DLL). In this scenario, modules are compiled into individual DLLs, which have the same interface[1]. After we registered these DLLs in the system, the application can easily find them and load them when it starts. We can also get some DLLs unregistered if we don’t need them. Such kind of application structure can be illustrated by the following figure.

Figure 2.a.2 Flexible Application Structure (DLL-Based)

However, this structure is not the best choice, because it is hard to implement and maintain. Users who use this application must know much about the DLLs and system programming. Data exchange between modules could be a big problem for system analysts.

Built-in script can also provide the application with flexibility, and it is very easy to use. In programmable application, what you need to do is, key in the script code, compile it, and run the compiled code, the application will do all the things that you want to do. You can also define your module by using the script, and you can even remove your module by deleting the script that you’ve just written. With the introduction of built-in script, data exchange is no longer a problem in the implementation of the application. Following is the structure of programmable application.

Application

Programming Environment

Libraries and APIs

Built-in script

Compiler / Interpreter

Module 1

Module 2

Module 3

Figure 2.a.3 Flexible Application Structure (Programmable)

b. Batch processing

Batch processing is another feature that comes with the programmability. Let’s take the student management system mentioned above for example, if we want to register a new student, we should first click the registration option on the menu, and a popup window will be displayed on the screen to let us input the name of the student, the gender, the date of birth and other related information. After we confirmed all the information, we should click “Register” button on the window to post the registration information to the system. We follow these steps to register only one student at a time, if we want several students to be registered, we have to repeat these boring steps.

Image that our student management system is programmable, we can define our commands (scripts) in the system, and we can define a command called “RegStudent”, which is used to register new students. All relevant information can be passed to the RegStudent command as parameter. If we want to register a student by using the command, what we want to type in may be similar to this:

RegStudent SunnyChen, Male, 09/23/80, ComputerScienceDept

Figure 2.b.1 RegStudent Command

The command above tells the compiler (or interpreter) to register a student whose name is SunnyChen to the system. Other information such as gender, date of birth, department, is passed to the RegStudent command as parameter, just like the first parameter (the name of the student) “SunnyChen”.

If we want to register several students, we just need to add more commands to the script. When we run the script, all the commands will be executed. For example, if we want to register three students whose names are SunnyChen, Tom and Jane, we can key in the following commands:

RegStudent SunnyChen, Male, 09/23/80, ComputerScienceDept

RegStudent Tom, Male, 03/22/81, CommunicationTechDept

RegStudent Jane, Female, 05/10/80, LanguageDept

Figure 2.b.2 RegStudent Commands

When we run the script above, the system will know what we want to do, and will get these three students registered.

Compared to the student management system that doesn’t support the programmability, we can register more than one student at a time by running the script. Such kind of processing is known as the batch processing.

c. The ability of Operation Copying

Programmable Application can support Operation Copying, with which we are able to copy the operation from one system to another, this because operations are written in script, and the script can be copied. We can copy the three RegStudent commands above to another system and register the three students there, instead of getting these students registered one by one manually.

How to make my application programmable

To make our application programmable, we must know much about the computer system, from hardware to software. Programmable application can provide new features to users, and it is very convenient for users to use, but it is really very difficult for the developers to implement.

From the paragraphs above, you can infer that the compile principle may be the most important thing in implementing the programmable application. Compile principle is really important, but before the implementation of the compiler, we must be expert in data structure and computer algorithm, because these two subjects are the bases of compile principle. For example, the grammar tree in the grammar analysis phrase can be represented by the tree structure, and the DAG-related issues in the code optimizing process can be solved by the introduction of graphic theory.

Another thing that we must know is which architecture should be used to implement such a programmable application. This mostly depends on the developer. Usually, we can just design a compiler to compile the script to the native code that can be easily understood by the system, it is the best choice when the system performance is considered to be the most important thing. However, if we want to make our script run on other application systems, or other platforms, we can’t directly compile the script to the native code, because the native code may not be supported by other platforms. What we want to do is, just compile the script to the intermediary code, and then design an interpreter to interpret the intermediary code. The following figure illustrates the architecture of this script mechanism.

Programming Environment

Libraries and APIs

Built-in scripts

Compiler

Intermediary Code

Compile

Interpreter

Figure 3.1 Architecture of platform-free programming environment

With the introduction of this architecture, we can make our script run on every system or platform. We just need to design one compiler to compile the script, and implement interpreters on each system or platform to interpret the intermediary code. Further more, we can define various forms of the built-in script[2] and design a compiler for each of it.

Figure 3.2 Architecture of platform-free programming environment (Multi-language)

[1] With this common interface, the application can easily locate the entry of Dynamic Link Library and load it when the application starts.

[2] These various forms of the built-in script can be known as different languages

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有