CN105740035B - A kind of method and system realized Flex dynamically load and increase class newly - Google Patents

A kind of method and system realized Flex dynamically load and increase class newly Download PDF

Info

Publication number
CN105740035B
CN105740035B CN201410768589.XA CN201410768589A CN105740035B CN 105740035 B CN105740035 B CN 105740035B CN 201410768589 A CN201410768589 A CN 201410768589A CN 105740035 B CN105740035 B CN 105740035B
Authority
CN
China
Prior art keywords
file
main application
class
party
main
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410768589.XA
Other languages
Chinese (zh)
Other versions
CN105740035A (en
Inventor
孙孟军
王庆磊
张国波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shenzhou Taiyue Software Co Ltd
Original Assignee
Beijing Shenzhou Taiyue Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shenzhou Taiyue Software Co Ltd filed Critical Beijing Shenzhou Taiyue Software Co Ltd
Priority to CN201410768589.XA priority Critical patent/CN105740035B/en
Publication of CN105740035A publication Critical patent/CN105740035A/en
Application granted granted Critical
Publication of CN105740035B publication Critical patent/CN105740035B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a kind of method and systems realized Flex dynamically load and increase class newly.Technical solution of the present invention passes through one third party's class libraries of creation, newly-increased class comprising realization this definition interface in third party's class libraries, pass through the third party's swc file for being compiled into third party's class libraries, it is put into togerther in main application project with the main swc file for realizing that the existing class of this definition interface is compiled into main application component library, and it is configured with dynamic assembly using increasing class newly to this in configuration file in dynamic assembly list configuration file, finally new main application swf file is generated by executing Ant compiling to the third party swc file and the main swc file in main application project, to realize, by this definition interface dynamically load, this increases class newly in main application.The technical program has mainly decoupled main application and class libraries by Ant compiling, is convenient for secondary development, main application developer can be not involved in, to substantially reduce development cost.

Description

A kind of method and system realized Flex dynamically load and increase class newly
Technical field
The present invention relates to data service technical field, in particular to it is a kind of realize Flex dynamically load increase newly class method and System.
Background technique
Flex is an efficient, free Open Framework, can be used for constructing the expressive web application of tool, realizes Browser-cross, desktop and operating system.Cannot achieve in flex development process at present as Java program operation when dynamic Some class is loaded, if necessary to increase a class in the main application component library Flex library project of exploitation, only will Flex library project generates swc file and is put under the path of swf file of compiled completion, can not visit at all Ask the class newly increased, this results in us swc file must be put into main application project Flex Project and recompilates swf File, while in order to quote newly-increased class, we must also go to rewrite code in Flex Project to quote newly-increased class, It is entirely different with the reference in Java, without the participation of Flex Project original developer, it is difficult to realize the two of Flex application Secondary exploitation.
Summary of the invention
In view of this, the main purpose of the present invention is to provide it is a kind of realize Flex dynamically load increase newly class method and System, for solving due to the technical issues of being limited the secondary development that Flex difficult to realize is applied by Flex technology.
In order to achieve the above objectives, the technical scheme of the present invention is realized as follows:
The present invention provides a kind of methods realized Flex dynamically load and increase class newly, this method comprises:
Step A defines an interface, by realization this definition interface in main application component library in main application component library Existing class is compiled into a main swc file, and the main swc file is put into main application project;
Step B creates third party's class libraries when doing secondary development, includes to realize that this is fixed in third party's class libraries The newly-increased class of adopted interface;
Third party's class libraries is compiled into third party's swc file by step C;
The third party swc file is also placed in main application project by step D, and in dynamic assembly list configuration file In the newly-increased class is configured;
Step E is generated by executing Ant compiling to the third party swc file and the main swc file in main application project New main application swf file, and the newly-increased class is configured in main application using in configuration file in dynamic assembly The dynamically load newly-increased class.
Optionally, this method further include: if dynamically load is also needed to realize the other newly-increased class of this definition interface, Increase the other newly-increased class in third party's class libraries of step B creation, and re-execute the steps C to step E.
Wherein, the main application swf file before the new main covering using swf file or the new main application Swf file is stored under the main same path of application swf file with before with different names.
Wherein, Ant compilation script, Flex Software Development Kit, dynamic assembly list are provided in the main application project Configuration file and dynamic assembly use configuration file.
Wherein, described by executing Ant compiling to the third party swc file and the main swc file in main application project Generating new main application swf file includes:
Ant compiling is executed to the third party swc file and the main swc file in main application project, is read by Ant dynamic The all components for realizing this definition interface are stated, and call the input/output terminal of Java by state the component list configuration file Cause for gossip shows file read-write, so that the component of dynamic assembly list configuration file configuration is all compiled into new main application swf text Part.
The present invention also provides the system for realizing that Flex dynamically load increases class newly, which includes main application component library, the Tripartite's class libraries and main application project,
The main application component library, for defining an interface, by realization this definition interface in main application component library Existing class is compiled into a main swc file, and the main swc file is put into the main application project;
Third party's class libraries, the creation when doing secondary development, for that will realize that the newly-increased class of the defining interface compiles It is also placed in the main application project at third party's swc file, and by the third party swc file;
The main application project, for being configured in dynamic assembly list configuration file to the newly-increased class, and Ant compiling is executed to the third party swc file and the main swc file and generates new main application swf file, and in dynamic group Part configures with dynamically load newly-increased class in main application the newly-increased class using in configuration file.
Optionally, third party's class libraries, if being also used to also to need dynamically load to realize the other of this definition interface Newly-increased class then increases the other newly-increased class in third party's class libraries of creation.
Optionally, the main application project executes the new main application swf file that compiling generates, or the master before covering It is stored under the main same path of application swf file with before using swf file, or with different names.
Wherein, the main application project offer Ant compilation script, Flex Software Development Kit, dynamic assembly list are matched It sets file and dynamic assembly and uses configuration file.
Wherein, the main application project is specifically used for executing Ant to the third party swc file and the main swc file Compiling reads dynamic assembly list configuration file by Ant, all components for realizing this definition interface is stated, and calls The input/output port of Java realizes file read-write so that the component of dynamic assembly list configuration file configuration be all compiled into New main application swf file.
Compared with prior art, the beneficial effects of the present invention are:
Skill of the scheme due to being limited the secondary development that Flex difficult to realize is applied by Flex technology in view of the prior art Art problem, technical solution of the present invention is by one third party's class libraries of creation, comprising realizing that this definition connects in third party's class libraries Mouthful newly-increased class this definition and is realized in main application component library by the third party's swc file for being compiled into third party's class libraries The main swc file that the existing class of interface is compiled into is put into togerther in main application project, and in dynamic assembly list configuration file Configured with dynamic assembly using increasing class newly to this in configuration file, finally by main application project to third party's swc text Part and the main swc file execute Ant compiling and generate new main application swf file, pass through this definition in main application to realize The interface dynamically load newly-increased class.
The technical program has mainly decoupled main application and class libraries by Ant compiling, secondary development is convenient for, if not Using this programme, secondary development is done every time, it is necessary to modify to the code of main application, that is to say, that main application developer is necessary Participate in secondary development;Use this programme when doing secondary development, main application developer can be not involved in, to substantially reduce out Send out cost.
Detailed description of the invention
Fig. 1 is a kind of schematic diagram realized Flex dynamically load and increase the method for class newly provided in an embodiment of the present invention;
Fig. 2 is a kind of structure chart realized Flex dynamically load and increase the system of class newly provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Integral Thought of the invention is: creating third party's class libraries when doing secondary development, includes in third party's class libraries The newly-increased class for needing dynamically load is compiled into third party's swc file by third party's class libraries, in main application component library The main swc file that existing class is compiled into is put into togerther in main application project Flex Project, and in main application project Flex Ant compiling is executed to the third party swc file and the main swc file in Project and generates new main application swf file, thus Realize dynamically load newly-increased class in main application.
In Flex technology exploitation, main application is divided to two engineerings, and one is Flex Project, main to apply entrance, below Being referred to as is main application project;One Flex library project, based on apply entrance Component Gallery, hereinafter referred to as based on answer Use Component Gallery.
Flex Project is a WEB engineering, it executes the main application swf file that compiling generates to swc file, can be with It is accessed by browser.Ant compilation script, Flex Software Development Kit (Software are provided in Flex Project Development Kit, SDK), dynamic assembly list configuration file and dynamic assembly use configuration file.
As shown in Figure 1, a kind of method realized Flex dynamically load and increase class newly provided in an embodiment of the present invention, this method master Include the following steps:
S110 defines an interface, by main application component library in main application component library Flex library project In the existing class of realization this definition interface be compiled into a main swc file, and main swc file is put into main application project Flex In Project.
An interface, the needs in Flex Project are defined in main application component library Flex library project The component of dynamically load is called in Flex Project by this interface, and realization this definition in main application component library is connect The existing class of mouth is compiled into a swc file, and in order to distinguish needs, referred to as main swc file, this main swc file will be put into For main application calling in Flex Project.
It is developed if it is first time, then in main application project Flex Project, Ant is executed to the main swc file and is compiled It translates and generates main application swf file, and used in configuration file with dynamic assembly to existing in dynamic assembly list configuration file Class is configured to be called in main application by this definition interface.
S120 creates third party's class libraries, includes realization this definition in third party's class libraries when doing secondary development The newly-increased class of interface.
When doing secondary development, we need to resettle one similar to main application component library Flex library Third party's class libraries of project contains in this third party's class libraries and realizes that this definition interface needs newly-increased class, these are newly-increased Existing class in class and main application component library all realizes the defining interface in main application component library.
Third party's class libraries is compiled into third party's swc file by S130.
Third party's class libraries can also be compiled into a swc file, and we term it third party's swc files.
Third party's swc file is also placed in main application project Flex Project by S140, and in dynamic assembly list The newly-increased class is configured in configuration file.
Third party's swc file is introduced in main application project Flex Project, while in dynamic assembly list configuration The dynamic loading type in third party's swc file is configured in file.At this point, third party swc file and main swc file are all put Enter in main application project Flex Project, has been equivalent to the main swc for introducing main application component library in third party's class libraries at this time File.
S150, by executing Ant to the third party swc file and the main swc file in main application project Flex Project Compiling generates new main application swf file, and dynamic assembly using in configuration file to the newly-increased class configured with Dynamically load newly-increased class in main application.
Specifically, the third party swc file and the main swc file are executed in main application project Flex Project Ant compiling reads dynamic assembly list configuration file by Ant, all components for realizing this definition interface is stated, and adjusts File read-write is realized with the input/output port of Java, so that the component of dynamic assembly list configuration file configuration is all compiled Into new main application swf file.
This it is new it is main can be covered using swf file before main application swf file, so that the result of this exploitation be made For final development result.Or new main be stored in using the name that swf file can also be different is answered with master before With under the same path of swf file, thus result of this exploitation developed before having no effect on as a result, programmer can be according to need Select the development result using not homogeneous.
A kind of alternative embodiment, after completing above-mentioned secondary development, if dynamically load is also needed to realize this definition interface Other newly-increased class, then increase the other newly-increased class in third party's class libraries of step S120 creation, and re-execute step Rapid S130 to step S150.
Specifically, the other newly-increased class comprising realization this definition interface in the third party's class libraries created, then will Third party's class libraries is compiled into third party's swc file, and third party's swc file is then placed again into main application project In Flex Project, and newly-increased class other to this in dynamic assembly list configuration file configures, and is finally answered by master It is another that Ant compiling generation is executed with the main swc file being put into engineering Flex Project to the third party swc file and before A new main application swf file, at the same dynamic assembly using newly-increased class other to this in configuration file configured with The newly-increased class is called by this definition interface in main application.
Based on the above-mentioned method realized Flex dynamically load and increase class newly, the embodiment of the invention also provides a kind of realizations The system that Flex dynamically load increases class newly.As shown in Fig. 2, the system includes main application component library 210,220 and of third party's class libraries Main application project 230,
The main application component library, for defining an interface, by realization this definition interface in main application component library Existing class is compiled into a main swc file, and the main swc file is put into the main application project;
Third party's class libraries, the creation when doing secondary development, for that will realize that the newly-increased class of the defining interface compiles It is also placed in the main application project at third party's swc file, and by the third party swc file;
The main application project, for being configured in dynamic assembly list configuration file to the newly-increased class, and Ant compiling is executed to the third party swc file and the main swc file and generates new main application swf file, and in dynamic group Part configures with dynamically load newly-increased class in main application the newly-increased class using in configuration file.
Wherein, main application project 230 provides Ant compilation script, Flex Software Development Kit, dynamic assembly list configuration File and dynamic assembly use configuration file.
Specifically, main application project 230 is compiled for executing Ant to the third party swc file and the main swc file It translates, dynamic assembly list configuration file is read by Ant, all components for realizing this definition interface are stated, and calls The input/output port of Java realizes file read-write so that the component of dynamic assembly list configuration file configuration be all compiled into New main application swf file.
A kind of alternative embodiment, third party's class libraries 220, if being also used to that dynamically load is also needed to realize this definition interface In addition newly-increased class then increases the other newly-increased class in third party's class libraries of creation.
It should be noted that main application project 230 executes the new main application swf file that compiling generates, or cover it Preceding main application swf file, or be stored under the main same path of application swf file with before with different names.
In conclusion scheme is due to being limited the secondary of Flex application difficult to realize by Flex technology in view of the prior art The technical issues of exploitation, technical solution of the present invention is by one third party's class libraries of creation, comprising realizing in third party's class libraries The newly-increased class of this definition interface, by the third party's swc file for being compiled into third party's class libraries, with reality in main application component library The main swc file that the existing class of existing this definition interface is compiled into is put into togerther in main application project, and is matched in dynamic assembly list Set in file and dynamic assembly configured using increasing class newly to this in configuration file, finally by main application project to the third Square swc file and the main swc file execute Ant compiling and generate new main application swf file, pass through in main application to realize This definition interface dynamically load newly-increased class.
The technical program has mainly decoupled main application and class libraries by Ant compiling, secondary development is convenient for, if not Using this programme, secondary development is done every time, it is necessary to modify to the code of main application, that is to say, that main application developer is necessary Participate in secondary development;Use this programme when doing secondary development, main application developer can be not involved in, to substantially reduce out Send out cost.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (10)

1. a kind of method realized Flex dynamically load and increase class newly, which is characterized in that this method comprises:
Step A defines an interface in main application component library, by the existing of realization this definition interface in main application component library Class is compiled into a main swc file, and the main swc file is put into main application project;
Step B creates third party's class libraries, connects in third party's class libraries comprising realization this definition when doing secondary development The newly-increased class of mouth;
Third party's class libraries is compiled into third party's swc file by step C;
The third party swc file is also placed in main application project by step D, and right in dynamic assembly list configuration file The newly-increased class is configured;
Step E is generated newly by executing Ant compiling to the third party swc file and the main swc file in main application project Main application swf file, and the newly-increased class is configured with the dynamic in main application using in configuration file in dynamic assembly Load the newly-increased class.
2. the method according to claim 1, wherein this method further include: if also dynamically load is needed to realize The other newly-increased class of this definition interface then increases the other newly-increased class in third party's class libraries of step B creation, and C is re-execute the steps to step E.
3. the method according to claim 1, wherein the master before the new main covering using swf file answers With swf file or it is described it is new it is main be stored in different names using swf file it is same with main application swf file before Under one path.
4. method according to claim 1-3, which is characterized in that the main application project provides Ant and compiles foot Sheet, Flex Software Development Kit, dynamic assembly list configuration file and dynamic assembly use configuration file.
5. according to the method described in claim 4, it is characterized in that, described by literary to the third party swc in main application project Part and the main swc file execute the new main application swf file of Ant compiling generation
Ant compiling is executed to the third party swc file and the main swc file in main application project, dynamic group is read by Ant The all components for realizing this definition interface are stated, and call the input/output terminal cause for gossip of Java by part list configuration file Existing file read-write, so that the component of dynamic assembly list configuration file configuration is all compiled into new main application swf file.
6. a kind of system realized Flex dynamically load and increase class newly, which is characterized in that the system includes main application component library, third Square class libraries and main application project,
The main application component library, for defining an interface, by the existing of realization this definition interface in main application component library Class is compiled into a main swc file, and the main swc file is put into the main application project;
Third party's class libraries, the creation when doing secondary development, for the newly-increased class for realizing the defining interface to be compiled into one A third party swc file, and the third party swc file is also placed in the main application project;
The main application project, for being configured in dynamic assembly list configuration file to the newly-increased class, and to institute It states third party swc file and the main swc file executes Ant compiling and generates new main application swf file, and make in dynamic assembly The newly-increased class is configured with dynamically load newly-increased class in main application in configuration file.
7. system according to claim 6, which is characterized in that third party's class libraries, if being also used to also need dynamic The other newly-increased class of this definition interface is realized in load, then it is other newly-increased to increase this in third party's class libraries of creation Class.
8. system according to claim 6, which is characterized in that the main application project executes the new master that compiling generates and answers With swf file, main application swf file before perhaps covering or it is stored in different names and applies swf with before main Under the same path of file.
9. according to the described in any item systems of claim 6-8, which is characterized in that the main application project provides Ant and compiles foot Sheet, Flex Software Development Kit, dynamic assembly list configuration file and dynamic assembly use configuration file.
10. system according to claim 9, which is characterized in that the main application project is specifically used for the third party Swc file and the main swc file execute Ant compiling, read dynamic assembly list configuration file by Ant, will realize this definition The all components of interface are stated, and the input/output port of Java is called to realize file read-write, so that dynamic assembly list The component of configuration file configuration is all compiled into new main application swf file.
CN201410768589.XA 2014-12-12 2014-12-12 A kind of method and system realized Flex dynamically load and increase class newly Active CN105740035B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410768589.XA CN105740035B (en) 2014-12-12 2014-12-12 A kind of method and system realized Flex dynamically load and increase class newly

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410768589.XA CN105740035B (en) 2014-12-12 2014-12-12 A kind of method and system realized Flex dynamically load and increase class newly

Publications (2)

Publication Number Publication Date
CN105740035A CN105740035A (en) 2016-07-06
CN105740035B true CN105740035B (en) 2019-01-18

Family

ID=56241461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410768589.XA Active CN105740035B (en) 2014-12-12 2014-12-12 A kind of method and system realized Flex dynamically load and increase class newly

Country Status (1)

Country Link
CN (1) CN105740035B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102253826A (en) * 2010-05-18 2011-11-23 深圳市金蝶中间件有限公司 Flex-based collection frame
US20110296376A1 (en) * 2010-05-26 2011-12-01 Sybase, Inc. Dynamically Injecting Behaviors Into Flex View Components

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102253826A (en) * 2010-05-18 2011-11-23 深圳市金蝶中间件有限公司 Flex-based collection frame
US20110296376A1 (en) * 2010-05-26 2011-12-01 Sybase, Inc. Dynamically Injecting Behaviors Into Flex View Components

Also Published As

Publication number Publication date
CN105740035A (en) 2016-07-06

Similar Documents

Publication Publication Date Title
CN106598579B (en) Method and apparatus for integrating dynamic type programming language on blockchain
CN109670951B (en) Block chain intelligent contract debugging and publishing method and system
CN108345531B (en) Test method, device and system
CN106775744B (en) Method and device for generating static library
US20130167128A1 (en) Application Compiling
CN107678748B (en) Source code file compiling method and device
CN103577324A (en) Static detection method for privacy information disclosure in mobile applications
CN105094878B (en) A kind of method and apparatus of integrated system library file
CN101183335A (en) Method and system for realizing embedded software unconventionality testing
CN106020877A (en) Automatic update method and apparatus for system environment configuration
CN112035112B (en) Application program development method, system, medium and electronic equipment
CN110659031A (en) Compiling method and device of application program, electronic equipment and storage medium
CN109871241A (en) A kind of configuration method of Cross-environment application server
CN113296742A (en) APP data processing method and device and mobile terminal
CN111399840A (en) Module development method and device
CN107526679A (en) Automated test frame, the automated testing method based on thereon, storage medium and computer equipment
CN108038241A (en) Integrated WEB visual workflows method, apparatus, readable storage medium storing program for executing and system
CN106254491A (en) A kind of stable IOS client framework model efficiently
CN106598662A (en) Application loading method and device based on android
CN104915199A (en) Method and device for converting Flash items into Html5 items
Shute Advanced JavaScript: Speed up web development with the powerful features and benefits of JavaScript
CN105740035B (en) A kind of method and system realized Flex dynamically load and increase class newly
CN108415737A (en) A kind of method and electric terminal loading plug-in unit in virtual machine
CN106681787A (en) Method and device for developing application
CN106325851A (en) Interactive remote cooperation method of Android application

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: Room 818, 8 / F, 34 Haidian Street, Haidian District, Beijing 100080

Patentee after: BEIJING ULTRAPOWER SOFTWARE Co.,Ltd.

Address before: 100089 Beijing city Haidian District wanquanzhuang Road No. 28 Wanliu new building 6 storey block A Room 601

Patentee before: BEIJING ULTRAPOWER SOFTWARE Co.,Ltd.