The method and device of load-on module
Technical field
The present invention relates to computer software fields, in particular to a kind of method and device of load-on module.
Background technology
Silverlight is a kind of Rich Client Technology, is the plug-in unit of cross-platform cross browser, can be application program
Exploitation provides relatively rich media function and interactive mode.Above application program can include many functions.In order to use and manage
Above-mentioned multiple functions can be divided into different modules, such as news template, sport module, electric business function mould by the convenience of reason system
Block etc., each module can all meet a kind of functional requirement of user.User is in the application program that Silverlight is used to develop
When, be all by the locally downloading operation of Silverlight application programs, it is and stronger and stronger with the function of application program,
Comprising module it is also more and more, Silverlight application programs also can be increasing, and user is needed to use application program
The time to be downloaded is also increasingly longer.
What needs to be explained here is that the function module that above application program provides, is not that each user is required for, has
A little function modules are just for particular kind of user's.For example electric business function module is just for electric business user, non-electric business
Class user does not need to such function module.But it no matter whether user needs is required for that all functions will be contained at present
The entire application program of module is locally downloading, can just use application program.
For in the method for existing load-on module, user need to be by all function modules including the unwanted mould of user
Block is all loaded into the problem of application program could use, and currently no effective solution has been proposed.
Invention content
It is a primary object of the present invention to provide a kind of method and device of load-on module, to solve existing load-on module
In method, all function modules need to be all loaded into application program including the unwanted module of user and could used by user
The problem of.
To achieve these goals, one side according to embodiments of the present invention provides a kind of method of load-on module.
This method includes:Acquisition module table, module table include pre-set module number ID, Customs Assigned Number ID and module number ID
With the correspondence between Customs Assigned Number ID;Customs Assigned Number ID according to currently recognizing is inquired from module table, is obtained
To the module number ID corresponding to the Customs Assigned Number ID currently recognized;Obtain the corresponding moulds of Customs Assigned Number ID currently recognized
Block program bag;Parsing module program bag, and modular program packet is loaded onto application program.
To achieve these goals, another aspect according to embodiments of the present invention provides a kind of device of load-on module.
The device includes:First acquisition unit, for acquisition module table, wherein, module table includes pre-set module number ID, uses
Correspondence between family number ID and module number ID and Customs Assigned Number ID;Query unit currently recognizes for basis
Customs Assigned Number ID inquired from module table, get corresponding to the Customs Assigned Number ID currently recognized module number
ID;Second acquisition unit, for obtaining the corresponding modular program packets of Customs Assigned Number ID currently recognized;Resolution unit is used for
Parsing module program bag, and modular program packet is loaded onto application program.
According to inventive embodiments, by acquisition module table, module table includes pre-set module number ID, Customs Assigned Number
Correspondence between ID and module number ID and Customs Assigned Number ID;According to the Customs Assigned Number ID currently recognized from module table
In inquired, get the module number ID corresponding to the Customs Assigned Number ID currently recognized;Obtain the use currently recognized
The corresponding modular program packets of family number ID;Parsing module program bag, and modular program packet is loaded onto application program, it has solved
In the method for load-on module, all function modules need to be all loaded into including the unwanted module of user using journey by user
The problem of sequence could use.
Description of the drawings
The attached drawing for forming the part of the application is used to provide further understanding of the present invention, schematic reality of the invention
Example and its explanation are applied for explaining the present invention, is not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of the method for according to embodiments of the present invention one load-on module;
Fig. 2 is the structure diagram of according to embodiments of the present invention two load-on module device;
Fig. 3 is the structure diagram of according to embodiments of the present invention two optional load-on module device;And
Fig. 4 is the structure diagram of according to embodiments of the present invention two optional load-on module device.
Specific embodiment
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the application can phase
Mutually combination.The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order to which those skilled in the art is made to more fully understand the present invention program, below in conjunction in the embodiment of the present invention
The technical solution in the embodiment of the present invention is clearly and completely described in attached drawing, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
Member's all other embodiments obtained without making creative work should all belong to the model that the present invention protects
It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, "
Two " etc. be the object for distinguishing similar, and specific sequence or precedence are described without being used for.It should be appreciated that it uses in this way
Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein.In addition, term " comprising " and " tool
Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit
Process, method, system, product or equipment are not necessarily limited to those steps or unit clearly listed, but may include without clear
It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
Embodiment one
An embodiment of the present invention provides a kind of methods of load-on module.As shown in Figure 1, that the method comprising the steps of is as follows:
Step S12, acquisition module table, module table include pre-set module number ID, Customs Assigned Number ID and module
Correspondence between number ID and Customs Assigned Number ID.
Specifically, application program can have multiple function modules, for example, Reports module, electric business module etc., in step S12
In, module table can define the disparate modules that different user needs load, as shown in table 1.
Table 1:
ModuleId |
AccountId |
01 |
user001 |
02 |
user001 |
03 |
user002 |
In table 1, user001 represents the number ID i.e. account of user of user, and 01 is the number of module, can with reference to table 1
To learn, the number of the module loaded required for user user001 is 01 and 02, and user user002 needs the module loaded
Number is 03, and optionally, the content in above-mentioned module table can be that system manager is preconfigured according to actual conditions.
Step S14 is inquired from module table according to the Customs Assigned Number ID currently recognized, is got and currently recognize
Customs Assigned Number ID corresponding to module number ID.
Specifically, when user uses application program by terminal device, the scheme that the application provides can recognize user
Number, the number to obtain the module corresponding to Customs Assigned Number is inquired in above-mentioned module table, that is, obtains current identification
To user need which module loaded, with reference to upper table 1, by Customs Assigned Number for for user001, user user001 is being opened
During application program, system can automatic identification user user001 Customs Assigned Number, then to inquiry user user001 in module table
Need module of the module loaded corresponding to 01 and 02.
Step S16 obtains the corresponding modular program packets of Customs Assigned Number ID currently recognized.
Specifically, can be that each function module develops a program bag, optionally, above procedure packet can be XAP
Packet, XAP packets are a compressed package, the procedure set needed when being run in compressed package comprising above application program and configuration.
Step S18, parsing module program bag, and modular program packet is loaded onto application program.
Specifically, the text in above-mentioned XAP packets can be obtained after the corresponding XAP packets of above-mentioned modules are parsed
Above-mentioned file is loaded onto application program by part.In a kind of optional embodiment, user downloads Silverlight application journeys
During sequence, that is, XAP packets are downloaded, then perform the procedure set in XAP packets so as to complete the loading procedure to each function module, here
It should be noted that XAP file is a file after the packing of Silverlight compiling of application, it is a standard
Zip compressed files include all files needed for Silverlight application programs, such as procedure set, resource file.
There is also the need to explanation, the function of the modular program packet loaded at this time loading required for above-mentioned Customs Assigned Number
All corresponding program bags of function module in program bag rather than application program corresponding to module.
In the embodiment of the present application, acquisition module table first is obtained in above-mentioned module table corresponding to Customs Assigned Number ID
Module is numbered, and is then obtained the corresponding program bag of above-mentioned module number, is then parsed above procedure packet, finally correspond to module
Program be loaded onto application program.In the method for solving load-on module, user need to by all function modules including with
The unwanted module in family is all loaded into the problem of application program could use, and the mould of its needs need to only be loaded by realizing specific user
Block can also use the effect of application program.
Optionally, in step S12 before acquisition module table, method provided in an embodiment of the present invention can also include:
Step S10 adds XML (Extensible Markup Language, extensible markup language) file, wherein,
XML file includes following at least one element:The path that module title, module number ID, modular program packet are stored.
Optionally, the title of module can also be included in above-mentioned xml document.
Specifically, Module.xml files can be added in the application, definition application include which module with
And the store path where modular program packet, it the following is the partial code in xml document:
<Xml version=" 1.0 " encoding=" utf-8 ">
<Modules>
<Module Id=" 2 " Name=" Report " XapPath=" ClientBin/Report.xap "/>
<Module Id=" 1 " Name=" ECommerce " XapPath=" ClientBin/ECommerce.xap "/>
</Modules>
What needs to be explained here is that it is found that the module name that block code ID is 2 is Report in above-mentioned code,
The store path of XAP program bags corresponding to Report function modules is ClientBin/Report.xap.
Optionally, after the corresponding modular program packets of the Customs Assigned Number ID currently recognized are obtained in step S16, this implementation
The method that example provides can also include:
Step S17 obtains the storage road of the corresponding modular program packets of the Customs Assigned Number ID currently recognized in XML file
Diameter, and pass through the modular program packet stored corresponding to the Customs Assigned Number ID that path download currently recognizes.
Specifically, with reference to above-mentioned xml code, it is found that the module name that block code ID is 1 is in above-mentioned code
The store path of XAP program bags corresponding to ECommerce, ECommerce function module is ClientBin/
ECommerce.xap, in the present solution, the journey corresponding to different function module can be downloaded to by above-mentioned XML file
Sequence packet.
Optionally, the module journey corresponding to Customs Assigned Number ID currently recognized in step S17 by storing path download
The step of sequence packet, can also include:
Step S171 creates WebClient (network agent class) object.
Step S172, by calling the asynchronous read method in WebClient (network agent class) object
(OpenReadAsync) the modular program packet according to corresponding to Customs Assigned Number ID is downloaded in storage path.
Specifically, after above-mentioned WebClient (network agent class) object is created, above-mentioned WebClient can be called
The asynchronous read method (OpenReadAsync) of (network agent class) object, above-mentioned asynchronous read method is in xml document
The value of XapPath downloads the corresponding XAP packets of above-mentioned module as parameter.
Optionally, XAML (eXtensible Application Markup can be included in above-mentioned XAP packets
Language, Scalable Application Markup Language) file, in a kind of optional embodiment, parsing module journey in step S18
Sequence packet, and the step of modular program packet is loaded onto application program can include:
Step S181 parses XAML files, obtains the target program collection in XAML files, wherein, target program collection is used for
Characterize the corresponding modular programs of Customs Assigned Number ID recognized.
Specifically, after above-mentioned WebClient (network agent class) object is created, WebClient (networks can be registered
Proxy class) OpenReadCompleted events in object processing function, it is above-mentioned after the completion of above-mentioned XAP downloads
OpenReadCompleted events can be triggered, then event handling function can be performed parsing XAML files and obtain in XAP packets
AppManifest.xaml files, this document definition XAP packet interfaces and comprising component.It is xaml files as follows
Partial code:
In the present solution, file above can be parsed, the EntryPointAssembly of Deployment elements is obtained
Attribute, according to title in all AssemblyPart elements of the attribute under Deployment.Parts elements and
The identical AssemblyPart elements of EntryPointAssembly attributes reuse the above-mentioned AssemblyPart elements found
The procedure set specified of Source attributes, above procedure collection, that is, above-mentioned target program collection.
Step S182 searches pre-defined homepage class from target program collection.
Homepage class (MainPage) is searched specifically, can be concentrated in above-mentioned target program.
Step S183 is grouped as homepage class in target program and creates object, and add the objects in application program.
Homepage class (MainPage) object is created specifically, can be concentrated in above-mentioned target program, which is added to
In some container of current application program.What needs to be explained here is which container be specifically added to, application program can be with
It is determined according to the situation of oneself, but whether which kind of situation is all within the protection domain of the application.
Optionally, step S14, before being inquired from module table according to the Customs Assigned Number ID currently recognized, this reality
The method for applying example offer can also include:
Step S13 carries out module table according to the selection of user any one or more following operation:Delete arbitrary a line
The record of module, the record of the arbitrary a line module of modification, the record for adding a line module.
Specifically, system can be deleted, changed or be added to above-mentioned module table according to the selection of user, example
Such as, user can select new module by triggering a button of Application Program Interface, the operation of system response user from
And module table is updated.User's next time when opening application program, can download according to the updated content of module table
New function module realizes the function module needed before the download that user can be selective.
The application is prepared under specific application scenarios by device below, and device processing and device are for the use of three
Expansion description:
Device prepares:
1. the function of application program is divided, multiple modules are divided into, each module completes relatively independent one kind
Function.For example it is divided into Reports module, electric business module.Each module must include homepage class (MainPage), this class is equivalent to
The main interface of this module, institute is functional all to be added in this main interface.
2. for each one XAP packet of Development of Module, entire one XAP packet of application program before.XAP packets are exactly one in fact
Compressed package, the inside include the procedure set needed when application program is run and configuration.User downloads Silverlight application programs
When, it is exactly to download XAP packets in fact, then performs the procedure set in XAP packets.
3. adding Module.xml files in the application, which module is definition application include.As follows
Example:
4. adding Module tables, which, which defines each user, needs the module loaded, structure such as the following table 2 of table.
Table 2:
ModuleId |
Module unique numbers |
AccountId |
Customs Assigned Number |
5. defining InstallModule operations, parameter ModuleId, AccountId is specified for designated user's installation
Module, this operates with two parameters and a line record is added in Module tables.
6. defining UninstallModule operations, parameter ModuleId, AccountId is specified for designated user's unloading
Module, the operation are deleted a line according to that two parameters in Module tables and are recorded.
7. defining GetAllModuleIds operations, parameter AccountId, acquisition designated user needs to load all
Module is numbered.Qualified all records are searched in the operation according to AccountId from Module tables.
Device processing:
1. addition installation functions of modules, user use the function mounting module after logging in.Specifically, it calls
InstallModule is operated, and transmits the module number of active user's number and installation as parameter.
2. defining Unload module function, user uses the function Unload module after logging in.Specifically, it calls
UninstallModule is operated, and transmits the module number of active user's number and installation as parameter.
Device uses:
1. after user logs in, calling GetAllModules operations, the AccountId for transmitting active user is parameter, is obtained
Active user needs the module loaded number.
2. being numbered for each module, corresponding module definition is found in XML file, according in module definition
XapPath loads the XAP packets of this module, and specific logic is as follows:
2.1. WebClient (network agent class) object is created.
2.2. the processing function of the OpenReadCompleted events of registration WebClient (network agent class) object.
2.3. the asynchronous read method (OpenReadAsync) of WebClient (network agent class) object is called, it is above-mentioned different
Read method is walked using the XapPath in above-mentioned xml document as parameter, and then downloads the corresponding XAP packets of above-mentioned module.
2.4. after the completion of XAP downloads, OpenReadCompleted events can be triggered, the event handling function of 2.2 steps
It can be performed.
2.5. in event handling function, XAP packets are read, obtain the AppManifest.xaml files in XAP packets, this
Document definition XAP packet interfaces and comprising component.It is an example as follows, raw content is simplified, deleting need not
Want content:
2.6. file above is parsed, the EntryPointAssembly attributes of Deployment elements are obtained, according to this
Title and EntryPointAssembly in all AssemblyPart elements of the attribute under Deployment.Parts elements
The identical AssemblyPart elements of attribute.
2.7. the procedure set specified using the Source attributes of the above-mentioned AssemblyPart elements found, in this program
It concentrates and searches homepage class (MainPage).
2.8. homepage class (MainPage) object is created, which is added to some container of current application program
In.Here without which specific container of explanation, application program can be determined according to the situation of oneself, no matter which kind of situation all should
It should be in the scope of this patent.
To sum up, the present invention can realize following technique effect:User can select the function of oneself needing, and only download oneself
The function of needing, and when needing using other functions, it is also very simple, it is only necessary to reconfigure, i.e., system manager can
To increase, be deleted or modified the record of any row module in above-mentioned module table acording to the requirement of user, application program is in next time
During startup, system can be all modules of user's loading corresponding thereto again according to new allocation list, so, under user
The time for carrying application program substantially reduces, and response speed improves, while does not influence the use of client also, while the application innovates
Point be embodied in installation module and Unload module process and will be in functions of modules loading application programs according to module XAP packets path
Process.
Embodiment two
The embodiment of the present invention additionally provides a kind of device of load-on module, as shown in Fig. 2, the device can include:
First acquisition unit 22, for acquisition module table, wherein, module table includes pre-set module number ID, uses
Correspondence between family number ID and module number ID and Customs Assigned Number ID.
Specifically, application program can have multiple function modules, for example, Reports module, electric business module etc., module table can be with
The disparate modules that different user needs load are defined, as shown in table 3.
Table 3:
ModuleId |
AccountId |
01 |
user001 |
02 |
user001 |
03 |
user002 |
In table 3, user001 represents the number ID i.e. account of user of user, and 01 is the number of module, can with reference to table 1
To learn, the number of the module loaded required for user user001 is 01 and 02, and user user002 needs the module loaded
Number is 03, and optionally, the content in above-mentioned module table can be that system manager is preconfigured according to actual conditions.
Query unit 24 for being inquired from module table according to the Customs Assigned Number ID currently recognized, gets and works as
Before module number ID corresponding to the Customs Assigned Number ID that recognizes.
Specifically, when user uses application program by terminal device, the use that can recognize of scheme that the application provides
The number at family is inquired the number to obtain the module corresponding to Customs Assigned Number in above-mentioned module table, that is, obtains current knowledge
The user being clipped to needs which module loaded, with reference to upper table 3, by Customs Assigned Number for for user001, user user001 is being beaten
When opening application program, system can automatic identification user user001 Customs Assigned Number, then to inquiring user in module table
Module of the module that user001 needs load corresponding to 01 and 02.
Second acquisition unit 26, for obtaining the corresponding modular program packets of Customs Assigned Number ID currently recognized.
Specifically, can be that each function module develops a program bag, optionally, above procedure packet can be XAP
Packet, XAP packets are a compressed package, the procedure set needed when being run in compressed package comprising above application program and configuration.
Modular program packet for parsing module program bag, and is loaded onto application program by resolution unit 28.
Specifically, the text in above-mentioned XAP packets can be obtained after the corresponding XAP packets of above-mentioned modules are parsed
Above-mentioned file is loaded onto application program by part.In a kind of optional embodiment, user downloads Silverlight application journeys
During sequence, that is, XAP packets are downloaded, then perform the procedure set in XAP packets so as to complete the loading procedure to each function module.Here
It should be noted that the journey corresponding to the function module that the modular program packet loaded at this time loads required for above-mentioned Customs Assigned Number
The corresponding program bag of all function modules in sequence packet rather than application program.
The embodiment of the present application acquisition module table first obtains the module corresponding to Customs Assigned Number ID in above-mentioned module table and compiles
Number, the corresponding program bag of above-mentioned module number is then obtained, above procedure packet is then parsed, finally by the corresponding program of module
It is loaded onto application program.In the method for solving load-on module, all function modules need to be not required to by user including user
The module wanted all is loaded into the problem of application program could use, realize specific user need to only load its needs module also may be used
To use the effect of application program.
Optionally, as shown in figure 3, device provided in an embodiment of the present invention can also include:
Adding device 20, for adding XML file, wherein, XML file includes following at least one element:Module title,
Module number ID, the path of modular program packet storage.
Specifically, Module.xml files can be added in the application, definition application include which module with
And the store path where modular program packet, it the following is the partial code in xml document:
What needs to be explained here is that it is found that the module name that block code ID is 2 is Report in above-mentioned code,
The store path of XAP program bags corresponding to Report function modules is ClientBin/Report.xap.
Optionally, as shown in figure 4, above-mentioned second acquisition unit 26 can also include:
Download module 261, for obtaining the corresponding modular program packets of Customs Assigned Number ID currently recognized in XML file
Storage path, and pass through and store path and download modular program packet corresponding to the Customs Assigned Number ID that currently recognizes.
Specifically, with reference to above-mentioned xml code, it is found that the module name that block code ID is 1 is in above-mentioned code
The store path of XAP program bags corresponding to ECommerce, ECommerce function module is ClientBin/
ECommerce.xap, in the present solution, the journey corresponding to different function module can be downloaded to by above-mentioned XML file
Sequence packet.
Optionally, above-mentioned download module 261 can also include:
Creation module 2611, for creating WebClient (network agent class) object.
Sub- download module 2612, for passing through the asynchronous read method called in WebClient (network agent class) object
(OpenReadAsync) the modular program packet according to corresponding to Customs Assigned Number ID is downloaded in storage path.
Specifically, after above-mentioned WebClient (network agent class) object is created, above-mentioned WebClient can be called
The asynchronous read method (OpenReadAsync) of (network agent class) object, above-mentioned asynchronous read method is in above-mentioned xml document
XapPath as parameter, and then download the corresponding XAP packets of above-mentioned module.
Optionally, above-mentioned resolution unit 28 can also include:
Parsing module 281 for parsing XAML files, obtains the target program collection in XAML files, wherein, target program
The corresponding modular programs of Customs Assigned Number ID that collection recognizes for characterization.
Specifically, after above-mentioned WebClient (network agent class) object is created, WebClient (networks can be registered
Proxy class) OpenReadCompleted events in object processing function, it is above-mentioned after the completion of above-mentioned XAP downloads
OpenReadCompleted events can be triggered, then event handling function can be performed parsing XAML files and obtain in XAP packets
AppManifest.xaml files, this document definition XAP packet interfaces and comprising component.It is xaml files as follows
Partial code:
In the present solution, file above can be parsed, the EntryPointAssembly of Deployment elements is obtained
Attribute, according to title in all AssemblyPart elements of the attribute under Deployment.Parts elements and
The identical AssemblyPart elements of EntryPointAssembly attributes reuse the above-mentioned AssemblyPart elements found
The procedure set specified of Source attributes, above procedure collection, that is, above-mentioned target program collection.
Searching module 282, for searching pre-defined homepage class from target program collection.
Homepage class (MainPage) is searched specifically, can be concentrated in above-mentioned target program.
Add module 283 creates object, and add the objects to application program for being grouped as homepage class in target program
In.
Homepage class (MainPage) object is created specifically, can be concentrated in above-mentioned target program, which is added to
In some container of current application program.What needs to be explained here is which container be specifically added to, application program can be with
It is determined according to the situation of oneself, but whether which kind of situation is all within the protection domain of the application.
Optionally, device provided in an embodiment of the present invention further includes:
Operating unit 30 carries out module table for the selection according to user any one or more following operation:It deletes
The record of arbitrary a line module, the record of the arbitrary a line module of modification, the record for adding a line.
Specifically, system can be deleted, changed or be added to above-mentioned module table according to the selection of user, example
Such as, user can select new module by triggering a button of Application Program Interface, the operation of system response user from
And module table is updated.User's next time when opening application program, can download according to the updated content of module table
New function module realizes the function module needed before the download that user can be selective.
The application is prepared under specific application scenarios by device below, and device processing and device are for the use of three
Expansion description:
Device prepares:
1. the function of application program is divided, multiple modules are divided into, each module completes relatively independent one kind
Function.For example it is divided into Reports module, electric business module.Each module must include homepage class (MainPage), this class is equivalent to
The main interface of this module, institute is functional all to be added in this main interface.
2. for each one XAP packet of Development of Module, entire one XAP packet of application program before.XAP packets are exactly one in fact
Compressed package, the inside include the procedure set needed when application program is run and configuration.User downloads Silverlight application programs
When, it is exactly to download XAP packets in fact, then performs the procedure set in XAP packets.
3. adding Module.xml files in the application, which module is definition application include.As follows
Example:
4. adding Module tables, which, which defines each user, needs the module loaded.Structure such as the following table 4.
Table 4:
ModuleId |
Module unique numbers |
AccountId |
Customs Assigned Number |
5. defining InstallModule operations, parameter ModuleId, AccountId is specified for designated user's installation
Module, this operates with two parameters and a line record is added in Module tables.
6. defining UninstallModule operations, parameter ModuleId, AccountId is specified for designated user's unloading
Module, the operation are deleted a line according to that two parameters in Module tables and are recorded.
7. defining GetAllModuleIds operations, parameter AccountId, acquisition designated user needs to load all
Module is numbered.Qualified all records are searched in the operation according to AccountId from Module tables.
Device processing:
1. addition installation functions of modules, user use the function mounting module after logging in.Specifically, it calls
InstallModule is operated, and transmits the module number of active user's number and installation as parameter.
2. defining Unload module function, user uses the function Unload module after logging in.Specifically, it calls
UninstallModule is operated, and transmits the module number of active user's number and installation as parameter.
Device uses:
1. after user logs in, calling GetAllModules operations, the AccountId for transmitting active user is parameter, is obtained
Active user needs the module loaded number.
2. being numbered for each module, corresponding module definition is found in XML file, according in module definition
XapPath loads the XAP packets of this module, and specific logic is as follows:
2.1. WebClient (network agent class) object is created.
2.2. the processing function of the OpenReadCompleted events of registration WebClient (network agent class) object.
2.3. the asynchronous read method (OpenReadAsync) of WebClient (network agent class) object is called, it is above-mentioned different
Read method is walked using the XapPath in above-mentioned xml document as parameter, and then downloads the corresponding XAP packets of above-mentioned module.
2.4. after the completion of XAP downloads, OpenReadCompleted events can be triggered, the event handling function of 2.2 steps
It can be performed.
2.5. in event handling function, XAP packets are read, obtain the AppManifest.xaml files in XAP packets, this
Document definition XAP packet interfaces and comprising component.It is an example as follows, raw content is simplified, deleting need not
Want content:
2.6. file above is parsed, the EntryPointAssembly attributes of Deployment elements are obtained, according to this
Title and EntryPointAssembly in all AssemblyPart elements of the attribute under Deployment.Parts elements
The identical AssemblyPart elements of attribute.
2.7. the procedure set specified using the Source attributes of the above-mentioned AssemblyPart elements found, in this program
It concentrates and searches homepage class (MainPage).
2.8. homepage class (MainPage) object is created, which is added to some container of current application program
In.Here without which specific container of explanation, application program can be determined according to the situation of oneself, no matter which kind of situation all should
It should be in the scope of this patent.
To sum up, the present invention can realize following technique effect:User can select the function of oneself needing, and only download oneself
The function of needing, and when needing using other functions, it is also very simple, it is only necessary to reconfigure, i.e., system manager can
To increase, be deleted or modified the record of any row module in above-mentioned module table acording to the requirement of user, application program is in next time
During startup, system can be all modules of user's loading corresponding thereto again according to new allocation list, so, under user
The time for carrying application program substantially reduces, and response speed improves, while does not influence the use of client also, while the application innovates
Point be embodied in installation module and Unload module process and will be in functions of modules loading application programs according to module XAP packets path
Process.
It should be noted that for aforementioned each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because
According to the present invention, certain steps may be used other sequences or be carried out at the same time.Secondly, those skilled in the art should also know
It knows, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of
Division of logic function, can there is an other dividing mode in actual implementation, such as multiple units or component can combine or can
To be integrated into another system or some features can be ignored or does not perform.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit,
Can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit
The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is independent product sale or uses
When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention is substantially
The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products
It embodies, which is stored in a storage medium, is used including some instructions so that a computer
Equipment (can be personal computer, mobile terminal, server or network equipment etc.) is performed described in each embodiment of the present invention
The all or part of step of method.And aforementioned storage medium includes:USB flash disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various
The medium of program code can be stored.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, that is made any repaiies
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.