The part of the disclosure of patent document comprises material protected by copyright.The copyright owner do not oppose anyone as in the patent document of United States Patent (USP) trademark office or record like that the photomechanical printing to patent document or patent disclosure copy, in any case still keep in addition all copyrights.
Generally speaking, software systems provide the software architecture of the component software in tissue and the interconnected computer systems.These component softwares are carried out the operation that gives its function to software application.Generally speaking, application program operates with some features, and these features have one or more assemblies separately.Assembly, and feature therefore can form from operation being parsed into one or more bottom software assembly less and more simple task.
When the structure software application, the software developer must use such as development languages such as C# and create component software.Creating command code, when namely giving the software code of its function to component software, the developer must be by calling or other constructs to create link between all component.For any function that is provided by application program, the software developer is generally all different software building component codes of executive utility special function, and code is manually write in the interconnection that relies between the component software of finishing the work each other.The software developer creates user interface (UI), data configuration and to the mutual required all operations between user and the application program.
In many application programs, UI, operation and data configuration are application-specific.Thus, in order to create application program, the software developer creates a large amount of codes usually.In addition, the software developer generally organizes and creates institute's correlate between the different fragments of software.For creating any application program, the software developer practices in necessary right and wrong Changshu, is complicated because be used for the substrate of establishment application program.
Owing to being used for the complicacy of the current method of generation application program, and owing to being used for singularity and the inevitable interconnectivity thereof of the code of given application program, the software developer can't be easily make amendment to current application program under having great efforts and not emitting the situation of the risk of the damage of existing application or expands.
The present invention considers to make for these and other just.
Provide this general introduction to come some concept that will in detailed description, further describe with below the form introducing of simplifying.This general introduction is not intended to identify key feature or the essential feature of the theme of this claim.
Various embodiments of the present invention are by providing a kind of software application framework to solve above-mentioned and other problem, and structure also was used for the execution of this software application of management when this framework was used to given software application generating run.The application program that is generated by application framework of the present invention is comprised of set or the figure of the application component that connects.Function according to the application program of this application framework configuration is enabled by each application component group dynamically is configured in the assembly territory, wherein each territory is configured to enable a given function of this application program, for example shows the picture in the word processing document.
For generating the run time organization that is used for application program, application program will pass to application program for the application program description of each required function of application and describe engine.This application program description provides the declarative that is used for structure and combine component territory rule, and this application program is described engine for the declarative rule of explaining when needed based on the data event that is received by application program for establishment and configuration component territory.The data event that is received by application program can by user action, for example, generate in response to the user selection to the function button in the user interface or control or data object.Data event also can be changed by the outside, is for example received by application program as the result of operation external progress or generates from Another Application program or the third party data that receive of originating.According to an embodiment, application program description and application program are described engine and are come structuring and/or operation according to extend markup language (XML).Although can provide action or other standard that event occurs and the simple means of stating in this framework with XML in this application framework, this application framework is not limited to only use XML.
This application program is described the engine explanation application program of each required function is described, and then obtaining is each required application component in required function structure assembly territory.According to an embodiment, this application program is described engine and obtain application component from the Component Gallery of safeguarding explicitly with application program.For example, this application program is described a territory that engine can be configured to the text in the display document, is used for second territory of object picture of display document and the 3rd territory etc. that is used for the function of format application program.
According to each embodiment, this application framework also comprises for the execution of management application program and comprises the execution administrative model in the territory of this application program.When term of execution generation such as the requirements such as data item in the deletion tables of data of application program are called given function of application and therefore required to call the data event in the specific components territory of enabling this function, assign single processing threads to the main body territory with the assembly in the territory of this data-driven event of executive basis by application program.
In case single processing threads enters the main body territory, the assembly in this territory is carried out according to the execute phase model by this thread.In the phase one, namely read/request stage, read desired data, for example, a value deleting from table object is the request of required change subsequently, for example, deletes the request of the value of asking from the sample table object.In subordinate phase, namely reaffirm/reconfigure during the stage, describe engine by application program and reaffirm or reconfigure this main body territory according to the change of asking.That is, application program is described engine and is reconfigured this territory according to the new configuration that is applicable to the data change where necessary.
During reconfiguring the stage, application program describe discardable this territory of engine some assembly, obtain this territory New Parent maybe that this territory is fully discarded.Thus, be the set of assembly with the life cycle of the time between the initial configuration of equaling and follow-up the reconfiguring to localization, wherein follow-uply reconfigure and then begin life cycle to next configuration (if there is) of localization.Therefore, describe each assembly territory that engine generates drives the required assembly of function as the data-oriented of executive utility set by application program, and this territory had by application program to the demand of the service in this territory determined life cycle.
The present invention and improved more comprehensively understanding thereof can be by obtaining with reference to the accompanying drawing of following brief overview, detailed description and the appended claims of following exemplary embodiment of the present.
Describe in detail
Accompanying drawing referring now to embodiments of the invention shown in it is described the present invention more comprehensively.Yet the present invention can specialize with many different forms, and should not be construed as limited to embodiment described herein.On the contrary, provide these embodiment to be devoted to so that disclosure is comprehensive and complete, and so that it can pass on scope of the present invention fully to those skilled in the art.
As above concise and to the point description the, various embodiments of the present invention provide a kind of structure and be used for the software application framework of the execution of managing software application programme when being used to given application program generating run.The run time organization of given software application is by the required one or more application components territory combination of one or more corresponding functions of carrying out this software application.Engine is described in response to each territory is described to generate from the application program that application program receives by application program in the assembly territory.Application program the term of execution, the unit of management is carried out in each assembly territory as application program, wherein each territory is used for carrying out the corresponding function of this application program.When application program receives when changing with the data of being associated for the locking assembly territory, this assembly territory is described engine by application program and is reconfigured as required data to be associated in response to this.The data that application program receives change or event can by user action, for example generate in response to the user selection to the function button in the user interface or control or data object.Data event also can be changed by the outside, for example received by application program as the outside result who carries out of operation or generate from Another Application program or the third party data that receive of originating.Thus, application program is based on set or the figure of the coupling assembling of being organized and dynamically being reconfigured by the data of application program reception and/or processing.
An example that wherein can realize suitable computingasystem environment 100 of the present invention is shown in Figure 1.Computingasystem environment 100 only is an example of suitable computing environment, is not that usable range of the present invention or function are proposed any limitation.Computing environment 100 should be interpreted as the arbitrary assembly shown in the exemplary operation environment 100 or its combination are had any dependence or demand yet.
The present invention can operate with numerous other universal or special computingasystem environment or configuration.Being applicable to well-known computing system of the present invention, environment and/or configuration includes but not limited to: personal computer, server computer, hand-held or laptop devices, multicomputer system, the system based on microprocessor, set-top box, programmable consumer electronics, network PC, minicomputer, large scale computer, comprise distributed computing environment of arbitrary said system or equipment etc.
The present invention can describe in the general context of the computer executable instructions of being carried out by computing machine such as program module etc.Generally speaking, program module comprises routine, program, object, assembly, data structure etc., and they are carried out specific task or realize specific abstract data type.The present invention also can put into practice in distributed computing environment, and wherein, task is by carrying out by the local and remote treatment facility of communication network link.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory storage device.
With reference to Figure 1A, be used for realizing that exemplary computer system 100 of the present invention comprises the universal computing device of computing machine 110 forms.The assembly of computing machine 110 can include but not limited to, processing unit 120, system storage 130 and will comprise that the sorts of systems assembly of system storage 130 is coupled to the system bus 121 of processing unit 120.System bus 121 can be any of several types of bus structure, comprises memory bus or Memory Controller, peripheral bus and uses any local bus in all kinds of bus architectures.As example but not the limitation, this class architecture comprises industry standard architecture (ISA) bus, MCA (MCA) bus, strengthens ISA (EISA) bus, Video Electronics Standards Association's (VESA) local bus and peripheral parts interconnected (PCI) bus, is also referred to as the Mezzanine bus.
Computing machine 110 generally includes various computer-readable mediums.Computer-readable medium can be by arbitrary usable medium of computing machine 110 access, to comprise volatibility and non-volatile media, removable and irremovable medium.As example but not the limitation, computer-readable medium comprises computer-readable storage medium and communication media.Computer-readable storage medium comprises with the volatibility of the either method that is used for the information such as computer-readable instruction, data structure, program module or other data that stores or technology realization and non-volatile, removable and irremovable medium.Computer-readable storage medium includes but not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, tape cassete, tape, disk storage or other magnetic storage apparatus, maybe can be used for storing desired information and can be by arbitrary other medium of computing machine 110 access.Communication media is embodied as usually such as the computer-readable instruction in the modulated message signal of carrier wave or other transmission mechanism, data structure, program module or other data, and comprises arbitrary information-delivery media.Term " modulated message signal " refers to arrange or change in the mode that the information in the signal is encoded the signal of its one or more features.As example but not limitation, communication media comprises wire medium, as cable network or directly line connect, and wireless medium is such as acoustics, RF, infrared and other wireless medium.Above-mentioned arbitrary combination also should be included within the scope of computer-readable medium.
System storage 130 comprises the computer-readable storage medium with volatibility and/or nonvolatile memory form, such as ROM (read-only memory) (ROM) 131 and random access memory (RAM) 132.Basic input/output 133 (BIOS) comprises as help the basic routine of transmission information between the element in computing machine 110 when starting, usually is stored among the ROM 131.RAM 132 comprises the processing unit 120 immediately addressable or current data that operating and/or program module usually, such as the module of structure under the XML application framework or execution.As example but not the limitation, Fig. 1 shows operating system 134, application program 135,204,304 (shown in Fig. 2 B, 3), other program module 136 and routine data 137; The XML application framework can be used for constructing and carry out for being stored in RAM 132 or from the application program of all softwares of wherein carrying out.
Computing machine 110 also can comprise other removable/irremovable, volatile/nonvolatile computer storage media.Only make example, Figure 1A shows computing machine 110 to have irremovable, non-volatile magnetic medium 141, irremovable, the non-volatile memory interface 140 read and write such as hard disk drive.Computing machine 110 also can comprise the non-volatile memory interface 150 to reading and writing such as the equipment such as disc driver 151, and 151 pairs of equipment are removable such as disk etc., non-volatile media 152 is read and write.In addition, computing machine 110 can comprise the CD drive 155 that removable, non-volatile CDs 156 such as CDROM or other optical medium is read and write.Other that can use in the exemplary operation environment be removable/and irremovable, volatile/nonvolatile computer storage media includes but not limited to tape cassete, flash card, digital versatile disc, digital recording band, solid-state RAM, solid-state ROM etc.Hard disk drive 141 is connected to system bus 121 usually by irremovable storage device interface such as interface 140, and disc driver 151 and CD drive 155 are connected to system bus 121 usually by the removable memory interface such as interface 150.
Above discuss and provide computer-readable instruction, data structure, program module and other data storage at the driver shown in Figure 1A and related computer-readable storage medium thereof for computing machine 110.For example, hard disk drive 141 store operation systems 144, application program 145, other program module 146 and routine data 147 are shown, they can be identical with routine data 137 with operating system 134, application program 135, other program module 136, also can be different from them.Here give different labels to operating system 144, application program 145, other program module 146 and routine data 147 and illustrate that they are different copies at least.The user can be by being linked to user input device, such as user's input interface 160 of keyboard 162 and positioning equipment 161 to computing machine 110 input commands and information.Other input equipment (not shown) can comprise microphone, operating rod, game mat, satellite dish, scanner etc.These and other input equipment is connected to processing unit 120 by the user's input interface 160 that is coupled to system bus 121 usually, but also can be connected with bus structure by other interface, such as parallel port, game port or USB (universal serial bus) (USB).
The display device of monitor 191 or other type also by interface, is connected to system bus 121 such as video interface 190.Except monitor, computing machine 110 also can comprise other peripheral output device, and such as loudspeaker 194 and printer 193, they connect by output peripheral interface 192.
Computing machine 110 can use one or more remote computers, is connected in the networked environment such as the logic of remote computer 180 to operate.Remote computer 180 can be personal computer, server, router, network PC, peer device or other common network node, and generally include many or all are above with respect to computing machine 110 described elements, although only show memory storage device 181 in Figure 1A.The logic that Figure 1A describes connects and comprises LAN (Local Area Network) (LAN) 171 and wide area network (WAN) 173, but also can comprise other network, such as wireless network.This class network environment is common in office, enterprise-wide. computer networks, Intranet and the Internet.
When using in the lan network environment, computing machine 110 is connected to LAN 171 by network interface or adapter 170.When using in the WAN network environment, computing machine 110 generally includes modulator-demodular unit 172 or is used for setting up other device of communication such as the Internet by WAN 173.Modulator-demodular unit 172 can be internal or external, and it can be connected to system bus 121 by user's input interface 160.In networked environment, can be stored in the remote memory storage device 181 with respect to computing machine 110 described program modules or its part.As example but not the limitation, remote application 185 resides on the memory devices 181.Be appreciated that the network connection that illustrates is exemplary, and can use other device of between computing machine, setting up communication link.
For the purpose of understanding and explanation, it will be favourable describing various embodiments of the present invention according to the example application program user interface that wherein shows the sample data object.Figure 1B shows the computer screen that shows an example word processing document and shows, the document is shown by the example word-processing application that one or more shown data objects are shown.Example user interface 195 shows the typical software application user interface that the user can be used for inputting, editing or process in addition according to the function of associated software application one or more data objects.For example, user interface 195 shows an example word-processing application, it has one or more functionality controls at the top, comprise " File (file) " control, " Edit (editor) " control, " View (view) " control and " Other (other) " control.Should be appreciated that the functionality controls shown in Figure 1B only for exemplary purposes, is not to being applicable to the restriction of a large number of users interface type, layout and functions associated available in the software application of the present invention.
User interface 195 comprises scroll bar 199, is used for as required by users the data that scroll user interface workspace up or down comprises.An example word processing document is shown in the workspace of user interface 195.This example document, such as letter, p.m.entry, form etc. comprise text object 196, the object picture 197 that embeds and the table objects 198 that embeds.Still with reference to Figure 1B, the document that is presented in the user interface 195 is rolled by the user, so that text object 196 is at the top of the page, the object picture 197 of embedding is displayed between two text objects, and table objects 198 at page base section as seen.That is, table objects 198 is just entering view, but is presented at not yet fully in the workspace of user interface 195.
As described in detail in the following, according to various embodiments of the present invention, be responsible for to show that example user interface 195 and sample data object 196,197,198 software application are set or the figure that is grouped together in the associated component in the logic groups, or be used for providing the territory of the required function of application program.Under any given example, application program comprises the run time organization that the logic groups by these associated components consists of, and is called as the territory herein, and it is to provide the function of application program required under this example.When executive utility, the change of the data that receive based on application program and application program are processed these data and are changed required functions associated and come dynamically configuration component territory.For example, still with reference to Figure 1B, be used for a current illustrative run time organization that is presented at the document of user interface 195 and comprise textview field, text territory comprises and shows and process the required application component of text object 196.Comprised and comprised the picture territory that shows and process the required application component of object picture 197, comprised comprising showing and the second textview field of the application component that second text object of processes and displays under object picture 197 is required, and comprised the form fields that comprises the required application component of table objects that demonstration enters 198.Other assembly territory that is associated with this run time organization comprises the application component for other function, any other side that comprises position and the display properties of the functionality controls in the position of scroll bar 199 and movement, the user interface and the required application program of the function of current requirement is provided.
As will be described in detail, therein data event received by application program application program the term of execution, the run time organization in assembly territory is dynamically reaffirmed and/or is reconfigured on request in response to the event of data-driven.For example, if user selection object picture 197 is deleted or is carried out other modification, then application program passes to application program with the data change and describes engine, the latter dynamically reconfigures the assembly territory of the object 197 of being responsible for Showing Picture, so that this assembly territory will comprise for based on the data event that receives, the deletion of object picture 197 or other suitable application component of object 197 of revising to Show Picture for example.In the required new function of application program, for example, in the situation in the view that the new data-objects such as table objects 198 is input in the user interface 195, application program is described engine with access application and is generated the New Parent territory that the required one or more application components of data object that imported into by demonstration consist of.
Fig. 2 A be application program is shown, application program is described the mutual functional diagram between engine and the one or more assemblies territory.According to various embodiments of the present invention, provide to be used for the application framework of application deployment for the coupling assembling figure of one or more functions of being used for carrying out this application program.With reference to figure 2A, application program 204,304 shows any software application that the programming of corresponding application programs is provided one or more useful functions for basis, such as word-processing application, spreadsheet applications, slide presentation applications, database application, desktop publishing application program, email application and calendar applications etc.In fact, as understanding from following description, various embodiments of the present invention are not limited to any specific software application.
According to various embodiments of the present invention, application program 204,304 is made of a plurality of application components, its each created by the software developer, be used for being independent of other assembly or providing explicitly given function with other assembly.For example, a given application component can be included in the application program 204,304, is used for providing the printing function of associated application.The Another Application program assembly can be included in this application program, is used for providing the specific format function of associated application.Usually, application program 204,304 given function, such as format, printing, editor, data demonstration etc. is by enabling when operating together and providing the application component of expectation function to enable.For example, a plurality of application components that must basis provide the particular sequence of required function to carry out can be provided the above function that be used for to show text object 196 or object picture 197 at the given software application shown in Figure 1B.As mentioned above, application program 204,304 no matter under the given example of run time organization or given the term of execution, all is set or the figure of the application component that connects at any time.Mutual being described in detail in below with reference to Fig. 2 B, 3,4,5 between different application assembly and the different application assembly described.
As above briefly describe, at any given time, application program 204,304 comprises a run time organization, and it is that application program is in the instantiation of the application component of required connection of this moment.As described below, the term of execution of application program, the instantiation of application component dynamically reconfigures by the application program change is required based on the data that application program receives.In order to generate the given run time organization of application component, application program 204,304 is described the application program of each required function and is described 318 from application program and be delivered to application program and describe engine 3 20.Application program is described 318 detailed description and application program and is described that operating in of engine is following to be provided.For example, later with reference to Figure 1B, be used for the instantiation of run time organization of user interface 195 and the functionality controls that the data that are associated will require application component demonstration user interface 195 and be associated, the table objects 198 that is text object 196, object picture 197, enters, and the current location of show scroll bars 199.
Application program 204,304 will be described for the application program of the current required function of application program and pass to application deployment or describe engine 3 20, be used for generating and configuration provides the grouping of each required application component of these functions.According to one embodiment of present invention, the application program description of describing engine from application passes to application program comprises the following declarative rule according to extend markup language (XML) structuring and format with reference to figure 2B and 3 descriptions.It is to comprise for the application program of explaining each required function that receives from application program 204,304 to describe and be used for making up and configuration provides the software module of enough computer executable instructions of the application component grouping (being called assembly territory or concurrency territory herein) of required function to application program 204,304 that application program is described engine 3 20.According to an embodiment, application program describes that engine 3 20 is following describedly to be operated according to extend markup language with reference to figure 2B, 3,4,5.Application program is described the function of engine and is operated in below with reference to Fig. 3 and under the title of " application program descriptive language " and describes in detail.
In case application program is described engine 3 20 and is received the application program that is associated with the required function of application program from application program 204,304 and describe, this application program is described engine namely according to satisfying each described function, and for example as shown in Figure 1B the object 197 required application components that Show Picture explain that application program describes.Determined required assembly and the relation between the required component in case application program is described engine, application program is described engine 3 20 and namely obtain required application component from Component Gallery 322, comprises required component interface.According to various embodiments of the present invention, Component Gallery 322 can be set or the storehouse with the application component that is associated such as application-specific such as word-processing applications, perhaps Component Gallery can be that application program is described engine 3 20 and therefrom can be obtained to provide the assembly set of the assembly of function such as word-processing application, spreadsheet applications, slide presentation applications, database application etc. for to a plurality of dissimilar application programs.
In case application program is described engine and obtained required application component (for example, the individual modules of software programming), this application program is described engine and is namely created assembly territory for each of application program 204,304 current required functions.As shown in Fig. 2 A, current data in response to the data shown in application program 204, the 304 couples of Figure 1B shows demand, and application program is described the 3rd assembly territory 260 that engine 3 20 creates the first assembly territory 250 that is used for text object 196, the second assembly territory that is used for object picture 197 and is used for table objects 198.That is, each in these assembly territories is described engine 3 20 by application program and is created, so that those the required application components of function that provide this application to require at present are provided in each territory.For example, picture territory 255 is described engine 3 20 by application program and is generated, to comprise that application program 204,304 is with those required application components of its current display characteristic and attribute display object picture 197.Be to be understood that, territory shown in Fig. 2 A shows can be to the territory of the generation of the data object shown in Figure 1B, but for any other example that is used for application program 204,304 run time organization, wherein shown different data objects and demonstration or location or configured in addition different user interface capabilities, then described engine 3 20 by application program and generate as required a different set of territory 250,255,260.
According to each embodiment, a kind of execution administrative model is provided, wherein each assembly territory is used as for application program 204,304 one and carries out administrative unit.When application program 204,304 receive data event, as describing in detail below with reference to Fig. 2 B, 3,4,5, application program 204,304 is described 318 with application program and is passed to application program and describe engine 3 20, be used for dynamically reconfiguring the territory 250,255,250 of one or more current configurations, or be used for creating as required neofield.For example, later with reference to Figure 1B, when scrolling up document, application program 204,304 requires to describe from application program the assembly territory that is used for showing new data-objects of engine 3 20.For example, table objects 198 is rolled enter view before, application program 204,304 does not require table objects territory 260, this is shown in Fig. 2 A, because application program 204, the 304 current functions that show table objects 198 that do not require.Yet, just be scrolled and entering view in case operating application program 204,304 operating system 134 detect table objects, operating system notification application 204,304, it now must show table objects 198 and the data that are associated thereof.As response, application program 204,304 will pass to application program be used to the application program description of the table objects 198 that enters as mentioned above and describe engine 3 20.Application program is described engine 3 20 and is explained that these application programs describe, obtain required application component and dynamic creation comprising showing the table objects territory 260 of those application components that this table objects that enters 198 is required.
Similarly, table objects is rolled and is left the bottom of the page if the document shown in Figure 1B is scrolled up, and then operating system no longer requires the demonstration of table objects 198 with notification application 204,304.Application program is described engine and is described in response to the application program that receives from application program 204,304 and will be discarded as application program 204,304 and show the table objects territory 260 that table objects 198 create, because no longer require the previous required assembly territory of table objects that shows.Thus, application program describe engine can based on application program 204,304 the term of execution requirement come dynamic creation or discarded to the locking assembly territory.
Application program 204,304 the term of execution, the operation by managing each assembly territory and modular construction realize carrying out management.Still with reference to figure 2A, application program 204,304 the term of execution, when application program 204,304 received the data event that calls to localization 250,255,260 function, application program 204 was processed this data event via corresponding territory.For example, an if data item in the user selection table objects 198, then select application program 204,304 deletion control to delete selected data item, then application program 204,304 receives the data event that the selected data item in territory and selected deletion control are associated.As understood by those skilled in the art, to the selection of data item and to the selection of deletion control by be responsible for operating application program 204,304 operating system detects, and makes the suitable notice of this data event to application program 204,304.
In response to this data event, application program 204,304 is to the single processing threads 275 of suitable territory 260 assignments of being responsible for processing the data event that is associated with table objects 198.In this main body territory, be also referred to as place, concurrency territory herein, single processing threads 275 enters this assembly territory, and processes this data event in a series of stages.About coming the main body territory of the event of deal with data driving to assign the detailed description of single processing threads to the assembly that is used for via the territory, see following description in the lower statement of title " to the multithreading in concurrency territory ".
Continue current example, in case selected the deletion control to come deletion selected data item from table objects 198, then be assigned to territory 260 in response to the single processing threads of the action data of Delete Table item.In case this processing threads enters this territory, the processing stage of starting first, i.e. read data/request msg stage.For example, during the phase one, read this data event with data item or the data value of the impact of the event of determining to be subject in the table objects 198 this data-driven by assembly territory 260.Then, as the part of the first operational phase, request is for example deleted the request of selected data item to the change of data from table objects 198.As response, the data connector assembly in the table objects territory is set up the request of deletion selected data item from table objects 198.The application program 204 that comprises the data connector assembly, 205 being described in detail in below with reference to Fig. 2 B, 3,4,5 of assembly are provided.In case read data/request msg stage finishes, processing threads will be notified allocator object (following detailed description), next the processing stage can begin.
Next the processing stage comprise that wherein describing engine by application program responds and in data event the change in assembly territory reaffirmed/reconfigure the stage.This reaffirm/reconfigure the stage during, notice and all data connector assemblies that affected data are associated, these data item of data connector assembly mark that for example are associated with the data item that will delete from table objects 198 are for reaffirming/reconfiguring.According to an embodiment, carry out during the son-stage that is marked at read data/request msg stage to influenced data.
In case mark all influenced data item, reaffirm/reconfigure that the stage continues, and process by demand the data item of each mark.For example, the data item that deletion will be deleted from table objects 198, and delete as required or add any territory assembly that is associated.For example, if the result as deletion selected data item need to remove the one or more application components that consist of influenced territory 260, then application program is described engine and will be during in response to the stage of reaffirming of data event be described 318 in response to the application program that passes to application program and describe engine and reconfigure this territory to remove these assemblies.On the other hand, if this affected territory needs new application component, then application program is described engine and will be obtained equally new application component and reconfigure to be integrated in the affected territory and to this territory.Thus, affected assembly territory dynamically reconfigures based on the data event that is associated with this territory term of execution of application program.Be described in detail in to provide in the lower banner " application framework phasing model " for the treatment of the execute phase model of data event in the assembly described herein territory 250,255,260.
As mentioned above, each assembly territory is described engine 3 20 by application program and is configured based on the current demand in application program 204,304 pairs of assembly territories.And, as mentioned above, when application program 204,304 demand response change in data events such as the deletion of data object, the interpolation of data object or the modification of data object, then create as required new assembly territory or reconfigure existing assembly territory.Have the life cycle that equals other assembly in this assembly territory for each New Parent in the locking assembly territory, because give locking assembly territory life cycle when it describes engine instance by application program or when it is described engine and reconfigured by application program, and finish when being dropped in this assembly territory or describing engine and reconfigure by application program subsequently.Thus, giving the locking assembly territory is existence and the function of application and the administrative unit that stop or disappear when follow-up the reconfiguring in this assembly territory in the time durations of the customized configuration in this assembly territory, and wherein the version that reconfigures subsequently in assembly territory is carried out the purpose of management and is considered to a new assembly territory for application program.
More than having described the set or the figure that are used for as coupling assembling comes the configuration software application program and for managing the structure of application program and the application framework of execution via one or more assemblies territory, provides the assembly of the given application program of formation and the detailed description of the communication between these assemblies below with reference to Fig. 2 B, 3,4,5.In addition, below provide the description of an above-mentioned exemplary embodiment to Fig. 2 B, 3,4 and 5 discussion, wherein application framework is based on the application framework of extend markup language (XML).XML application framework (XAF) provides the method and system that is used for carrying out and creating as mentioned above software application.XAF is fabricated at standard language, and it represents data change, data event, UI event or all other generation events with standard format in software systems.
In one exemplary embodiment, XAF adopts XML (extend markup language) that data are expressed as the XML data, and application program is expressed as the XML application program.Afterwards, will in description, represent standard language with XML.Yet, person of skill in the art will appreciate that, the invention is not restricted to use XML.
The XAF software systems are that data focus on, data-driven, and powerful data transformation ability is provided, and include but not limited to mutual from the heterogeneous data in the source of not knowing mutually.All parts of XAF all can be described to for or relate to the event of data, comprise the behavior of the user interface of application program and application program.It is that data creation person and data are the patterns that create that XAF has abandoned application program.On the contrary, the XAF based on data makes up application program.In various embodiments of the present invention, the XAF application component in fact based on how to show data, data be what and how storage data comes instantiation and interconnection.Thus, XAF can create and sew up " correct " assembly and process particular data in correct mode when operation.
When making up application program, XAF allows application program " author " to provide about how based on data type and user interface (UI) to create assembly and connects together rule.These rules and assembly can be write with XML.XML is allowed for the UI that enriches and can organize structure to the current context sensitivity, and allows the software developer to make up application program with the method for group structure.The software author can be in reducing the required declarative models of hard coded application logic end-to-end ground construction feature or application program.For example, the software author only need state that a certain specific UI connector and a certain specific UI and a certain specific action match.Then XAF links together this UI connector and this UI and action.
In addition, this XML application framework provides the abundant storehouse of assembly, application features and the example application program of prebuild.Although still need some commanding code, XAF is placed on assembly in the storehouse.The storehouse allows other software author to use or utilize these assemblies in declarative models.Thus, the software developer can create its own assembly by generate new commanding code for assembly, but the software author also can adopt the assembly of prebuild to make up new or modified application program and need not to create any commanding code newly.
Exemplary XML application framework 202 is shown in Fig. 2 B.XAF 202 is used for the execution of structure and management such as the application programs such as application program 204.Application program 204 in XAF 202 interior execution comprises one or more UI connectors 206, one or more action 208 and one or more data connector 210.In certain embodiments, application program 204 also comprises one or more memory accesses 212 or one or more transducer 214 and/or 216.Assembly in the application program 204 is used for the UI event is transformed into the data change and data are transformed into the UI event.Thus, UI connector 206 is coupled to one or more UI 218 and/or 220.In addition, data connector 210 is coupled to one or more data storages 222 and/or 224.In XAF 202, the data event in the application program 204 or data representation adopt standard format.For example, data event and data representation adopt XML.
UI connector 206 provides being connected between application program 204 and one or more UI 218 and/or 220.In one embodiment, UI 218 and/or 220 is the graphic user interfaces that show information to the user.UI connector 206 presents and the support application program user edits the ability of the data in the XAF 202.UI connector 206 is mapping (enum) data between XAF data Layer (being represented by data connector 210 and data storage 222 and/or 224) and specific UI 218 and/or 220.In addition, UI connector 206 operates the UI event from the data edition that UI 218 and/or 220 is mapped in the data storage 222 and/or 224.
The type of the UI element among 206 couples of UI 218 of UI connector and/or 220 is special-purpose.Thus, each UI for the data item in UI 218 and/or 220 represents existence one corresponding UI connector 206.In one example, the data element that is presented in UI 218 and/or 220 such as the cell value in the electrical form etc. will have the specific UI connector 206 that is coupled to this data element, and it will be revised the user of these data convert the UI event to be connected to the action 208 on the XAF data.Thus, UI connector 206 converts specific UI event generally in the XAF of XAF application program 204 interior expressions action 208 to.In one embodiment, all data changes in the application program 204 are represented as the change of XML data.In another example, user-operable is such as user interface controls such as scroll bars.The change of scroll bar has caused the change of the state of UI 218 and/or 220.The UI state changes also can be represented as the data change.Thus, UI connector 206 can receive to convert to for the XML data of XAF data Layer such as UI events such as scroll bar operation, with this UI event and change event.
UI connector 206 is connected to action 208 with the UI event.Action 208 is the declarative statements for the data change of XAF data Layer.For example, can create " click on scroll bar " event to user's operation of scroll bar.UI connector 206 is connected to this UI event such as actions 208 such as " scroll bar are increased progressively a position downwards ".In one embodiment, data change action represents with XML.For example, the data change can be used as the appearance of XML statement:
<Dropdown?data=$taskpanelist>
<copy?Deltaaction?peform=″on?selected?change″
data=selected?value″
target=″current?taskPane″/>
Data connector 210 arrangements are to and from the data of external data storage 222 and/or 224.Be similar to UI connector 206, data connector 210 in different pieces of information storage 222 and/or 224 inside XAF data representation and the external data type between change.Thus, there is data exclusive data connector 210 in each external data type.Data connector 210 receives action 208, and converts standard format XAF data action 208 to the data dedicated action to affect the data in the data storage 222 and/or 224.In one embodiment, data connector 210 converts the XML data action to the data dedicated action.For example, the scroll bar operation that is represented by standard format XML statement is converted into the data storage 222 or 224 that the interfacial state exclusive data changes and be sent to storage specific interface status data.
In addition, data connector 210 converts the change in the data storage 222 and/or 224 to send to UI connector 206 standard format XAF data representation.UI connector 206 converts standard format XAF data representation to the UI event that sends to UI 218 and/or 220.Thus, for any change in UI 218 and/or 220, UI connector 206 is connected to action 208 with user interface event.Action 208 is sent to the data connector 210 that action 208 is converted to the special-purpose change of data in the data storage 222 and/or 224.In case data are changed, data connector 210 becomes standard format XAF data representation with the data-switching that changes in the data storage 222 and/or 224.Data connector 210 sends it back UI connector 206 with the XAF data representation, and it converts the XAF data representation to UI-special-purpose presented event.UI connector 206 sends to UI 218 and/or 220 for demonstration with the special-purpose presented event of UI-, and UI 218 and/or 220 shows from the data of the change of UI event establishment here.
Application program 204 can continue the everything deal with data of application programs 204 interior generations and these the periodic changes between the UI event.In certain embodiments, the change of the data in the data storage 222 and/or 224 also forces the change of UI 218 and/or 220 and need not to occur customer incident, such as the data of forcing change by another operation outside user's control.
But some optional component in the application program 204 comprises memory access 212 and transducer 214 and/or 216.Memory access 212 is reconciled between action 208 and data connector 210.Be the data of a certain particular type in a certain specific data storages 222 of access and/or 224, action 208 can be specified to use and is used for this data access device 212 or " Access Model ".Memory access 212 allows the data of inhomogeneous particular types such as JPEG, MPEG of application program 204 accesses.Thus, regardless of the type of the data in the data storage 222 and/or 224, application program 204 is interface and change this data all.Memory access 212 guarantees that data connector 210 management comprise any data type of the data type of not yet design or exploitation.Memory access 212 is transformed into the data of standard format-customization with standard format action and moves.
In other embodiments, one or more transducers 214 and/or 216 are reconciled between data connector 210 and UI connector 206.Transducer 214 and/or 216 will become UI connector 206 and show required UI custom formats from the data output of data connector 210.For example, if the data that UI connector 206 needs in the tabulation, then transducer 214 and/or 216 can become data list with the tabular form data modification by one or more simple changes, and wherein each simple change by single inverter 214 and/or 216 is carried out.Thus, any type of data of being exported by data connector 210 all can be transformed into by one or more gauge transformation devices 214 and/or 216 can be by 206 acceptance of UI connector and the form of using.About such as the discussing in detail of the operation of transducer 214, the transaction transforms such as 216, see with the description under the lower banner " transaction transforms ".
Can utilize according to various embodiments of the present invention the conversion of other type.For example, functional mapping can be used such as functional languages such as XQuery and describe.A list of locations is got in agency's (proxy) conversion, and acts on behalf of the data that find in these positions with the form of another name data sequence.Solver (solver) conversion is implemented the solver technology of appointment and support high-speed cache for the purpose of efficient.For example, a solver conversion is found the solution the algebraically equation system in number, and another solver is then found the solution these systems on symbol.High-speed cache and index conversion be data level pass through (pass-through) conversion (namely, the output data equal to input data), and high-speed cache and index conversion are added high-speed cache and index with the indexed access in acceleration downstream in specified dimension.
According to various embodiments of the present invention, this application framework has adopted the common interface between the assembly of application program described herein.Because the data communication of this framing dependence between the various assemblies of describing herein, so the valid data that uniform data structure between the assembly (such as XML etc.) and common interface are allowed for application deployment and management exchange.
With reference now to Fig. 3,, in various embodiments of the present invention, XAF 300 comprises two or more application programs 302 and/or 304, as shown in Figure 3.Larger application program 302 can comprise the one or more application programs 306 and/or 308 as submodule or sub-component.All application programs 302 and/or 304 no matter be larger application program or sub-component, all have such as UI connector 206 connectors such as UI such as grade, such as the action actions such as 208 and such as data connectors such as data connectors 210.Thus, application program 306 and/or 308 be particular data element 314 and/or 316 and specific UI element 310 and/or 312 between the operation software module.Application program 302 and/or 304 can be multithreading, and this shows that they can engage some other application programs 302 and/or 304 and operate.In addition, application program 302 and/or 304 or application component 306 and/or 308 can be constrained to moment or territory, as will be described in detail.
In various embodiments of the present invention, XAF 300 comprises that the XML application program is described (XAD) 318 and the XML application program is described (XAD) engine 3 20.XAD 318 comprises declarative rule and the description such as application program 304 all application programs such as grade that comprises in the XAF 300.The software author is the required application program creation XAD 318 of software author.XAD 318 comprises be used to pulling (pull) or instantiation specific software components and with these component bindings scheme and label together.In various embodiments of the present invention, it is how mutual that scheme and label relate to assembly.Assembly can be UI connector, action, memory access, data connector, transducer or other component software.In certain embodiments, assembly is write with command code, and provides pointwise (point-wise) function to application program.Thus, assembly can be the bottom software that operability is provided to XAF assemblies such as UI connector, action, data connector.
Can represent with other form although application program describes 318, in one embodiment, XAD318 represents with XML.Label is the XML label.Scheme and label provide syntax and the semantic frame that is used for the statement rule.XAD allows resource and the order of application author statement range of applications.Order is based on the code bit position that events such as mouse click, keyboard selection, voice command is carried out.In each embodiment, the user creates the event in the user interface, and in other embodiments, another action of certain process can create event.Order can be adopted the form of named part, for example changes to select action, editing view action, retrieve data action and edit entries action, as described below with reference to Figure 17.Should be appreciated that these named parts are for purposes of illustration, and be not to the order that is applicable to various embodiments of the present invention and/or the restriction of named part.
XAD 318 carries out grammatical analysis by XAD engine 3 20.At first, XAD engine 3 20 carries out grammatical analysis to XAD 318 when starting application program.Afterwards, XAD engine 3 20 carries out grammatical analysis to XAD 318 when needed.For example, according to an embodiment, XAD 318 carries out grammatical analysis with such as reconfigure application program in instantiation and when connecting plug in component in when operation by XAD engine 3 20.According to another embodiment, provide wherein when compiling the compilation model that XAD is carried out grammatical analysis and convert thereof into the mark sequence of being explained when the operation by the XAD engine.When not compiling, when XAD is loaded in the storer, finish the text grammer analysis, and it is stored as data structure.
XAD engine 3 20 processing rules, identifying resource, instantiation assembly and coupling assembling, component and order.Assembly and resource can be commanding codes, such as the executable code of writing with C#.Commanding code has characterized component software and the software class of the reality under UI connector, action, data connector and other XAF assembly.Assembly is from such as pulling out Component Gallery 322 Component Galleries such as grade.Component Gallery 322 keeps having all component that uses in any application program of XAF 300.
Whole assembly set in the storehouse 322 is all available to any application program.Thus, XAF 300 allows the abundant of code of application programs assembly and these assemblies of establishment to share.In addition, XAF is very extendible, because can be created New Parent and it is stored in the Component Gallery 322 by the software developer.XAD engine 3 20 therefore can the new regulation that the software author creates among the XAD 318 be called by reading, instantiation be connected with the connection New ParentThen new regulation and New Parent can form new XAF assembly, new data type, new data storage, new UI or or even new application program.XAD and XAD engine following with more detailed description.
An embodiment for the method 400 of carrying out customer incident is shown in Figure 4.In this embodiment, customer incident operation 402 at first occurs.Yet, person of skill in the art will appreciate that, method 400 can be used for carrying out not corresponding with customer incident data and changes.As described, the data that received by application program change or event can by user action, for example generate in response to the user selection to the function button in the user interface or control or data object.Data event also can be changed by the outside, is for example received by application program as the result of operation external progress or generates from Another Application program or the third party data that receive of originating.In addition, explain in conjunction with Fig. 2 B as above, customer incident can be any change of carrying out in such as UI 218 UI such as grade of user or mutual.Attended operation 404 is receiving customer incident such as UI connector 206 places such as connector such as UI such as grade, and customer incident is connected to such as action 208 etc. moves accordingly.
Provide operation 406 to provide the standard format action for the data change of expression in the action.In one embodiment, the XML statement represents the action for the data change.In one embodiment, can choose non-productive operation 408 wantonly is connected to such as memory access 212 memory accesses such as grade action to help configuration to be used for the action of the particular data of change.Memory access sends to the data dedicated action such as data connector 210 data connectors such as grade.Conversion operations 410 receives this data-dedicated action, and this standard format action (can be the XML statement) is converted to for code and data-dedicated operations such as specific data storages such as data storages 222.
Making data in the data storage changes.Then, data connector reads the data of change from the data storage.The data that change are converted into such as standard datas such as XML data representations and represent.Optionally, then standard data represents to be sent to such as transducer 214 transducers such as grade.Can choose change operation 412 wantonly and will be changed by the data recording that transducer receives into UI exclusive data statement.For example, this data change can require to show data with tabulation.One or more transducers can be classified and create the final data statement that presents data with tabulation the data that retrieve.Then transducer will change and the data of conversion offer such as UI connector 206 connectors such as UI such as grade.
Then attended operation 414 receives the data that change and is connected to show and provide the data of this change with the UI assembly.Thus, UI provides the view of the data that change now.In one embodiment, it can be user interface state that data change, and the demonstration of the data that change is demonstrations of the user interface of change.As represented by the flow process that continues to get back to customer incident operation 402, the reception event, affect data and change and show that the process 400 of the data that change is iteration, and can change each customer incident or data and repeat realization.If data change or event causes or require reconfiguring of application program, then can be as describing to create below with reference to Fig. 5 and connecting and/or reconfigure New Parent.
Be used for to create and an embodiment of the method 500 of configuring application program shown in Figure 5.Operation (launch) operation 502 starts such as application programs such as application programs 204.In one embodiment, the user is by customer incident, such as starting application program by clicking application icon.504 pairs of parser operation are carried out grammatical analysis such as XAD 318 XAD such as grade.In one embodiment, scheme and/or the rule in grammatical analysis sign and the processing XAD.
The sign operation necessary resource of 506 identification application and/or assembly.In one embodiment, assembly and resource find in such as Component Galleries such as Component Galleries 322.This assembly of instantiation operation 508 instantiations.In one embodiment, the assembly that identifies in the instantiation Component Gallery in form such as the assisting device code in XAD engine 3 20 engines such as XAD such as grade.In another embodiment, one group of interim creator assembly of instantiation.This creator assembly then instantiation about the processing components of input data and the rule that is associated with label among the XAD.
Attended operation 510 connects the assembly of instantiation.In one embodiment, the XAD engine comes coupling assembling according to the customer incident of employed data or processing.In case instantiation has also connected application component, wait for that operating 512 namely waits for customer incident.Thus, the XAD engine is kept a kind of passive existence (passivepresence) with this application program.XAD engine continuously monitoring data changes, and in response to being changed by the data that provide such as data connectors such as data connectors 210.When data change, determine operation 514 specified datas change whether require reconfiguring of application program, as inserting plug in component.If require to reconfigure, then flow process proceeds to parser operation 504 by "Yes".If do not require to reconfigure, then flow process proceeds to by "No" and waits for operation 512.
As described herein, a kind of structure and be used for the application framework of the execution of managing software application programme when being used to given software application generating run is provided.Below be the detailed description of the each side of the invention described above embodiment, comprise the operation of transaction transforms and function, via processing and be used for generating and the application program that reconfigures application component is described the operation of engine in the assembly territory of stage modeling and threading.
Transaction transforms
As mentioned above, the one or more data storages that are used for via one or more connectors receptions and storage data are provided.According to various embodiments of the present invention, data can be come optionally and the data store isolated by using one or more " transaction transforms ".Fig. 6 shows the tissue of data Layer and shows being connected between data Layer and other assembly that comprises data storages and data client.Transaction transforms 614 comprises for the data that store isolation with about the cache module 616 of the status information of data, and binding cache module 616 uses two-Phase Commitment Protocol so that failed submission needn't cause the control module 618 of loss of data.Below more discuss cache module 616 and control module 618 in detail.
Data storage 602 and 604 data that are included on database server or the computer-readable medium.Data can read and write wherein from the data storage as described above.Can be sent by the agency who is connected to data-oriented storage and check or whether a certain other asks to check to data storage data writing feasible.If data writing is feasible, then certainly indicates one and pass the agency back.Equally, if data writing be infeasible or whether feasiblely do not know, then negate indication with one and pass the agency back.
Data connector 606 and 608 is connected to data storage 602 and 604 with data transformation 610,612 and 614.In one embodiment, store with the data of processing one or more types at data connector 606 and 608 each agreement of interior realization.The data storage of each one or more type of protocol processes is such as using specific format coded data library file.Data modification or the change that receives from data client 622 and 624 submitted on data connector agreement minimum unit ground to.The above UI connector 206 of describing with reference to figure 2B is data client 622,624 example.
In one embodiment, data connector 606 and 608 is realized minimum unit by conservative concurrency (pessimisticconcurrency).Conservative concurrency relates to the subset (for example, one or more record) of the data in the locking data storage to prevent that client is to affect the mode Update Table of other client.In conservative concurrency model, when client executing causes using the action of locking, other client can not carry out will with the action of this locking violation, discharge this locking until have the client of this locking.This model may have therein a large amount of competitions of pair data and/or wherein be lower than with the cost of locking protected data in the situation that to occur in the environment of cost of concurrency conflict rollback affairs be useful.When conservative concurrency is short in the lock time best, such as use when procedural processings of record.
In another embodiment, data connector 606 and 608 uses the optimization concurrency (optimistic concurrency) with compensating movement to realize minimum unit.Optimize concurrency and do not utilize locking.When the first client needed more new record, this agreement had determined whether another client has changed this record since this record is read for the last time by the first client.Optimizing concurrency is useful in having the environment of few data contention.Compensating movement is the action of the effect of compensating transaction.For example, be that fund with equal number goes back to account A from account B to the compensating effect of the bank transfer of fund from account A to account B.Similarly, be that cancellation keeps to the compensating movement that keeps hotel room.Compensating movement allows affairs by " rollback ", or in the situation that does not have residual spinoff or other negative results to be retracted.Compensating movement is used between two clients rollback affairs when clashing (for example, the first client reads a data value, and then the second client had been revised this data value before the first client attempts to revise this value).In one embodiment, data connector 606 and 608 high-speed caches are stored respectively 602 and 604 data from data.If the data that data client is asked, then need not the data of asking to corresponding data storing queries by the data connector high-speed cache.Data connector will more discuss in detail hereinafter.
Data transformation 610,612,614 and 620 is encoded and/or decoded data according to the predefine rule.Data transformation 610,612,614 and 620 realizations can be carried out the function of the processing of any complexity.Each other serial of data transformation 612 and 620.Therefore, the result of the function that is realized by data transformation 612 is as the input of the function that is realized by data transformation 620, and vice versa.In one embodiment, data transformation can be connected the result with the previous conversion of buffer memory serially, and allows easier and Modularly realization sophisticated functions.Equally, (seeing below) can be submitted or refresh to the subset of the data in the view in the situation that does not affect the remainder data in the view.
Data transformation 614 is a kind of special data transformations that are called transaction transforms, and similarly comprises cache module 616 and control module 618.In one embodiment, transaction transforms allows the data minimum unit ground of isolation and submits in data consistent mode between the data storage.The isolated data that cache module 616 keeps from data client 622 and 624.In one example, data client 622 and 624 is the dialog boxes for the data of editing data storage 604.The editor that data are made can be stored in the cache module 616 when making editor fully.In another embodiment, transaction transforms will shine upon back stitching to the edit requests of its input for the edit requests of its output.As a result, when making when editor, input/request entity is identified as this editor and finishes.In addition, these transaction transforms allow these editors' delay and controlled mapping with its buffer memory 616, will be as discussed below.
Can be carried out by transaction transforms the control operation of some types.When the user wishes in data client 622 or data client 624 to submit data to (for example, when activating " application " button that is associated with data client), control module 618 receives from this data client and submits control operation to, and attempts to use the two-stage concurrency agreement below in conjunction with Fig. 6 discussion to submit data to.In one embodiment, the data of buffer memory can deletion after in a single day successfully submitting in the cache module 616.When the user wished data (and data are displayed in the corresponding data client thus) in the flush buffers, control module 618 received refresh control operation from this data client, and the data in the flush buffers module 616.The data that refresh are transmitted to data client, so that the data that user-accessible upgrades.The ability that refreshes isolated data can replace the submission in tradition two-stage concurrency model to use, as discussing below with reference to Fig. 6.
In some cases, useful is to upgrade the data in the buffer memory and not submission that discarded one or more users use one or more data client to make changes.In this case, can send the synchro control operation by data client.When control module 618 received the synchro control operation from data client, the latest edition in the based on data storage was upgraded the isolated data in the cache module 616, and will the data that not submit change and renew to of isolated data be merged.Synchronizing process to two or more sets changes of data is known in the art, and can use in all cases synchronously.About how realizing in given context that synchronous details is very specific for this context.For example, in the context of product database, the line of the product in the merge database is acceptable, and still merging is unacceptable to the change of two kinds of versions of the title of a product.Other context can have for synchronous Else Rule, and all these can use in conjunction with the present invention.It also is known managing conflict.Can provide and follow about in the situation that the conflict which renewal material pre-defined rule should be arranged.But other embodiment reminding user solves these conflicts.
Cache module 616 is safeguarded the status information that can change based on the type of current afoot operation.For example, if submit well afoot to, then status information can comprise that submitting to is co-pending, success or failure.Perhaps, if refresh well afoot, then status information can comprise and refreshes co-pending or finish.If the synchronous operation well afoot, then status information can comprise it being co-pending, success or failure synchronously.Below more discuss specific control operation in detail.
Addressable some data of data client may not need isolation.For example, the change of financial database (such as being used for following the tracks of bank account) is normally submitted to immediately.In one embodiment, the data-oriented view can comprise isolation and isolated data not.In another embodiment, the data-oriented client can comprise the read-only data that can not edit in data client.
In response to receiving application specifications from application developer, one embodiment of the present of invention identify this application program which partly need isolated data and realize as required transaction transforms.Fig. 7 shows the operating process of transaction transforms operation.Receive operation 702 and receive application specifications.In one embodiment, application specifications has been specified the XAF application program, comprises which data should be isolated, and sign operation 704 identifies and the tag application program is interior with segregate corresponding data entity.
Realize one or more transaction transforms that operation 706 realizes corresponding to each data entity that is marked as the data entity that will isolate.Transaction transforms is then to be connected with the essentially identical mode of data transformation and to activate.
Fig. 8 shows the control operation that operation is carried out according to transaction transforms.Receive operation 802 and receive the control operation request from data client.In one embodiment, this request triggers by the UI control that user's click is associated with data client.Determine whether operation 804 definite these control operation requests ask submit operation.If this control operation request is for submit operation, then flow process is branched off into by "Yes" and sends operation 908 (Fig. 9).If this control operation request is not for submit operation, then flow process branches no to and determines operation 806.
Determine whether operation 806 definite control operation requests ask synchronous operation.If this control operation request is for synchronous operation, then flow process is branched off into to send by "Yes" and preserves operation 808.If this control operation request is not for synchronous operation, then flow process branches no to refresh operation 810.
If asked synchronous operation, then preserve operation 808 and preserve any data that change to this buffer memory of not submitting to.Submit to change a file that can be saved on the computer-readable medium, the Computer Storage that arrives volatibility or nonvolatile memory or other form, perhaps be submitted to external data base or similarly service.Then flow process advances to refresh operation 810.
The fresh copy of the data of the buffer memory that exists in the refresh operation 810 retrieve data storages, and place it in buffer memory that transaction transforms is associated in.Refresh operation 810 may require to inquire about some data and store to determine which data storage comprises the fresh copy of these data.In another embodiment, refresh operation 810 checks that alternately or in addition storing the data connector that is associated with each data checks whether this data connector comprises the cached copy of the data of buffer memory with adding.
Determine whether operation 812 definite these control operation requests ask synchronous operation.In one embodiment, determine that 812 of operations need to check the result who determines operation 806.If the control operation request is for synchronous operation, then flow process is branched off into union operation 814 by "Yes".If the control operation request is not for synchronous operation, then flow process branches no to the end of operating process.
If asked synchronous operation, then union operation 814 will by preserve that operation 808 preserves to data cached change and the data cached merging that is refreshed by refresh operation 810.The rule that be used for to merge the data subject of two kinds of versions changes based on the context of application program.Some exemplary rules presents in conjunction with Fig. 6.In one embodiment, a plurality of changes from the different pieces of information client can be combined to realize synchronism in each data client.
Fig. 9 shows the request of submitting to of processing how according to one embodiment of present invention.Receive operation 902 from the data client receive data.In one embodiment, data client is the dialog box that application user is used to input data, and data send when the UI control that is associated with this dialog box is activated.Caching 904 then with data buffer storage in one or more transaction transforms or with storer that these one or more transaction transforms are associated in.
When receiving operation 906 and receive request to submit operation, call modified two-Phase Commitment Protocol.At first, send operation 908 and send the request of submitting to a plurality of data connectors that are associated with the data storage.In one embodiment, submit to request to comprise the data that to submit to.Submit request to by one or more data connectors of these data of high-speed cache and/or keep one or more data storages of these data to be received, and as being treated by the request of the assurance of minimum unit ground submission data.Receive data connector and/or the data storing received response of operation 910 from keeping these data.In case receive all responses, determine that operation 912 determines whether that all take over partys of this submission request agree to submit to.If all take over partys agree, then flow process is branched off into transmit operation 914 by "Yes".If be not that all take over partys agree, then flow process branches no to transmit operation 916.
If all take over partys agree to submit to data, then transmit operation 914 to by send the operation the 908 submission requests of sending all take over party's submiting commands.The take over party submits these data (that is, change with this upgrade its oneself data) to.
If be not that all take over partys agree to submit to data, then transmit operation 916 sends the abort order to the take over party.Therefore the take over party knows that the submission of suggestion can not occur, and any data that are associated with this submission can be dropped.In one embodiment, transmit operation 916 only sends the abort order to the take over party who agree to submit data to, and disagrees with that the take over party who submits data to automatically abandons these data and need not to order clearly it to do like this.Then, refresh operation 918 is carried out the data that refresh control operates flush buffers.In one embodiment, refresh operation 918 changes into and carries out the data that synchro control operates synchronization caching.
Other embodiments of the invention have also been conceived.In one embodiment, each transaction transforms can comprise the policy module of implementing synchronization rules.In another embodiment, policy module is given for and refreshes and synchronous concurrency strategy.Exemplary concurrency strategy comprises conservative concurrency (conservative concurrency) (wherein always making the complete copy to the data of all buffer memorys) and optimize concurrency (wherein data only are copied in the buffer memory) when requiring.Policy module also can allow policy moduleization ground to add to process the control operation of other type of not discussing herein.
In another embodiment, can use transaction transforms to visit and deal with data in conjunction with query language.SQL (Structured Query Language (SQL)) is widely used a kind of such query language.XQuery is another kind of such query language.Also conceived the use to other query language in conjunction with the present invention.
In another embodiment, the part that data connector 610 can provide and (to a certain extent) manages buffer memory, for example buffer memory among Fig. 6 and logic 616.In this case, the connector data that have access and/or process buffer memory refreshing and/or the logic of Synchronization Component with the control data.
Application framework phasing (phasing) model
As above briefly describe, application program and/or application component can be constrained to some stage.Generally speaking, retrain the execution of software approach in computer system by making component software obey the multilayer phasing model stage by stage.Component software can be other software code construct in class, object, method or the computer system.Stage is while and the common mode of operation of being shared by one group of component software.Computer system is carried out the top layer phasing model, be also referred to as main phasing model, and occurs one or more son-stage during one or more stages of this main phasing model.Operation in the computer system is constrained to one group of stage or son-stage.
An exemplary embodiment of multilayer phasing model 1000 is shown in Figure 10.This multilayer phasing model has and comprises three phases 1002,1004 and 1006 first or main stage model.The main stage is with occurring in sequence of being described by arrow 1016.In two son-stages, namely son-stage 1 1008 and son-stage 2 1010 occured during the stage 11002.In addition, in addition two son-stages, namely son-stage 2a and son-stage 2b occured during son-stage 2.Thus, phasing model 1000 has represented to have one group of multilayer stage in the son-stage that occurs during other stage or son-stage.Hereinafter, any discussion in stage also be can be applicable to son-stage.
Each component software is restrained in a moment and operates.Each software approach is imposed restriction only carry out or is called during the stage that this software approach is constrained to.Can cause the software approach of conflict or contradictory outcome to be constrained to the different stages, just can not be called legally from the current generation at this this software approach.Thus, each software approach is carried out in known manner and can not produced conflict between the method for finishing the contradiction task.All methods are all carried out under a specific phase constraint, retrain in the compatible state so that software systems are called as to be in the current generation.
Refer again to Figure 10, the stage 1 1002 is the superphase in son-stage 11008 and son-stage 2 1010.In addition two son-stages, namely son- stage 2a 1012 and son- stage 2b 1014 occured during son-stage 2 1010.Equally, son-stage 2 1010 is superphase of son- stage 2a 1012 and son-stage 2b 1014.Any stage or son-stage can have son-stage.Not restriction of the number of plies for the son-stage in the multilayer phasing model.In addition, in any stage space, must there be at least two stages, but to not restriction of the number of stages on two stages.In addition, if son-stage is arranged, then must there be at least two son-stages in superphase, but to the not restriction of number in son-stage of during any superphase on two son-stages, occuring.Any son-stage group can be during superphase circulation primary or repeatedly.
Stage model 1000 shows stage space.Stage space is the limited digraph of determining effective stage (node of graph) and effective phase transition (limit of figure).Therefore, stage space has been determined effective sequence of stages.Stage space 1000 was defined within on phase set phase 1 1002, stage 2 1004 and stage 3 1006.Stage space 1000 also has three phases conversion 1018a, 1018b and 1018c.When phasic change occured when phase transition represented to share all component softwares in pre-converted stage.
When component software was shared the one-phase space, these component softwares were parts of phase domain.Phase domain is one group of software of reaching an agreement to by the public phasing model of moment definition space.For example, agree to be had the main stage 1002, all component softwares of 1004 and 1006 main stage space constraint are parts of main phase domain.Thus, all component softwares that are associated with component software in the main phase domain comprise with the main stage 1002,1004 and 1006 at least one phase constraint that is associated.
Phase constraint is to be limited in the effectively static constraint in stage in a certain program context.Especially, constraint can be applied to program segment, thereby asserts that this program segment only carries out during deferring to the stage of this constraint.In one embodiment, phase constraint is written as the attribute in the bracket, such as [Phase 1].This data structure will be explained in more detail following.
Computer environment 1100 with the one or more assemblies that occupy one or more phase domain is shown in Figure 11.Conversion and the foundation of the main stage space of main guidance device 1102 controls.All component in this computer environment is the part of main phase domain 1100, but can occupy one or more son-phase domain.For allowing establishing stage territory 1100, the strategy that program author needs the choice phase space, the execute phase changes on this stage space and the strategy of processing the message of striding the phase domain border.
Phase domain 1100 can be characterized by the multilayer stage space.In various embodiments of the present invention, register to main guidance device 1102 such as one or more assemblies such as assemblies 11104.The software construction of any type of assembly 1 1104 expressions comprises component software or method.Component software 1104 is restrained to one of stage in the main stage space.
In other embodiments, one or more son-guidance devices such as son-guidance device 1 1106 and son-guidance device 2 1108 are to main guidance device 1102 registrations.Son-guidance device control has one or more other phase domain in one or more different phases space.Thus, phase domain 1100 has one or more nested phase domain.Be restrained in son-stage space and one or more son-stages in one or more main stage of main stage space such as assembly 2 1110 all components such as grade to son-guidance device 1 1106 registration.In one embodiment, the son-phase domain by son-guidance device control operates in the stage at single primary.The operation in son-stage can repeat to occur during the single primary stage.
In various embodiments of the present invention, such as son-guidance device 2-guidance devices such as grade to register to create further nested son-phase domain such as son-guidance device 3 other son-guidance devices such as grade.In certain embodiments, son-guidance device operation 21108 Control Components 3 1112 and son-guidance device 3 1114.In other embodiments, such as above assemblies such as assembly 4 1116 and assembly 5 1118 such as control such as son-guidance device 3 1114 guidance devices such as grade.The controlled fixture of each son-guidance device has the stage space of unique stage.Thus, son-guidance device 1 1106 operation the first son-stage spaces, and son-guidance device 3 1114 operation the second son-stage spaces.If two-stage space is not mutual, then stage space is called as orthogonal intersection space.The combination of orthogonal phase spaces can form cartesian phase space, and it can be used for being formed for the phase domain of single product.Bottom stage group is the cartesian product of orthogonal phase group, and wherein effectively phase transition also is the cartesian product of effective conversion of orthogonal phase group.
In various embodiments of the present invention, guidance device is logical timer.The clock that guidance device is similar in the hardware system cycles through each stage.When each phase transition, guidance device changes the stage of all component softwares in the phase domain simultaneously.In one embodiment, any son-guidance device can change the son-stage in son-phase domain simultaneously.Logical timer is waited for the operation in the stage that is restrained to or is being constrained in finishing of the operation carried out in the son-stage in this stage.
An exemplary embodiment of stage space 1200 that can be used for main phase domain is shown in Figure 12.Stage space 1200 has three phases.During read request phase 1202, the request that will read or write data or other software command or the request queue in the software systems are until enter next stage.In one embodiment, the non-repetition methods of some of only asking was carried out in next stage, and other method is waited for next circulation in another stage or stage.
Suitable component software will be ordered and be asked to be directed to update stage 1204.In various embodiments of the present invention, in update stage 1204, software components fulfill commands or request.In one embodiment, update stage 1204 has the son-stage space 500 that occurs during update stage 1204.A shown in Figure 5 and hereinafter explanation of example temper-stages 500.In one embodiment, update stage 1204 triggers the son-stage that is used for data Layer.In other words, any request of data being write realized in the son-stage of update stage 1204.
Phase III, reaffirm that namely the stage 1206 is instructed and execution untreated other method during update stage 1204.In one embodiment, all requests of retrieve data are finished during reaffirming the stage 1206.For example, in update stage 1204, upgraded data after, notify all component softwares that the data change has occured, and the data upgraded of notified software components retrieve.In one embodiment, reaffirm stages 1206 operation son-stage space 600.The exemplary embodiment 1300 of son-stage space is shown in Figure 13 and in following description.
For a change the stage, stage space 1200 passes through phase transition.In this exemplary embodiment, three phases conversion 1208a, the 1208b and the 1208c that have the conversion between the expression three phases 1202,1204 and 1206.As mentioned above, phase transition is to change the stage clock such as guidance device 1102 guidance devices such as grade, and is used for the time point that stage of all component softwares changes simultaneously in the phase domain.
To can occuring about the current generation or to prompting or the notice of the conversion of new stage of the component software in the phase domain.In one embodiment, all component softwares of guidance device notification phase.In other embodiments, requesting method requires the stage to guidance device.In various embodiments of the present invention, the conversion notice is sent to the one or more component softwares in the phase domain.In one embodiment, conversion notice occurs during the current generation or at the place that begins of next stage.In other embodiments, notification procedure is adopted the independent stage.For example, stage space 1200 can have three notification phase that are positioned at conversion 1208a, 1208b and 1208c place, is used for the component software in the notification phase territory.
An example temper-stage space 1300 of update stage 1204 is shown in Figure 13.Son-stage 1300 is used for data Layer in certain embodiments.In other words, be restrained to one of son-stage of data-stage space 1300 for the method that data is write shared data structure.In one embodiment, all component softwares of sharing these data agree to submit to this change or abort to change in the contract stage 1302.This changes submitted or abort in submission or abort phase 1304.
In another embodiment, contract stage and submission or abort phase are the son-stages in " submitting to or abort " son-stage 1304, and son-stage space 1300 has marking phase 1302 but not contract-stage 1302.Herein, data change in submission or abort phase 1304 makes, and uses all component softwares of these data to be labeled for upgrading at marking phase 1302.The marker software assembly is that sign is set in component software, retrieves the data of upgrading in suitable later phases with this component software of signaling.In one embodiment, the component software of mark is being reaffirmed stages 1206 retrieve data.In another embodiment, marking phase 1302 has two son-stages: mark-stage and final mark-stage., use the component software of these data to be labeled in son-stage at mark herein, and in final mark retrieve data in son-stage.
Another example temper-stage space 1400 that occurs during reaffirming the stage 1206 is shown in Figure 14 A.Be constrained in an exemplary change in the software construction of son-stage space 1400 shown in Figure 14 B.Son-stage space 1400 is provided for the son-stage of plug-and-play operation.Plug and play-stage space 1400 has two stages: with son-stage 1404 and slotting son-stage 1402.Generally speaking, in slotting son-stage 1402, set up, change or remove combination and the configuration of component software, but do not carry out any service time of function.Equally, with in son-stage 1404, to combination or the configuration that conventional func uses component software to set up, do not make up or the configuration aspect but do not set up, change or remove.
The exemplary embodiment that module reconfigures is shown in Figure 14 B.In this embodiment, software module has the first configuration 1406.After such as a certain actions such as user's input requests, software module changes the second configuration 1408 into.Person of skill in the art will appreciate that, software module differently operates in the first configuration 1406 with in the second configuration 1408.Thus, reconfigure should with this software module mutual with the stage during do not have method to carry out situation under occur.In various embodiments of the present invention, in slotting son-stage 1402, software instances is initialised, connects or disconnects, and sets a property.In certain embodiments, other son-stage helps customization inserting the operation of carrying out in son-stage 1402.
In one embodiment, slotting son-stage 1402 has other son-stage.Constructor-stage 1410 by the known class of instantiation, call component software or with the interface on the existing example obtain one the clone's or the example of being derived specially create new software instances.At last, initial beggar-stage 1414 sets a property and requires negotiation between the example of exact connect ion.Son-the stage of inserting in son-stage 1402 can be departed from son-stage presented herein.In addition, this son-stage 1404 also can comprise son-stage.
Conceived other stage by stage space.For example, conceived the son-stage space that is used for the user interface change.In user interface-stage space, invalid son-stage can be allowed for making up the execution of the method for structure.Then son-the stage of drafting draws the structure structure.As skilled in the art will recognize, can use other stage space to the operation of other type.In addition, person of skill in the art will appreciate that the above exemplary stages space that presents can change aspect the number of the number in stage or son-stage, layer or level and the type in stage or son-stage.Thus, the present invention is extendible.In one embodiment, new superphase is superimposed on the existing stage space.In another embodiment, the new stage is added to existing stage space.In some embodiment that also have, add the new layer of son-stage more how or son-stage space to existing stage space.
Exemplary embodiment of data structure 1500 with phase constraint that the code constraint item carries out is shown in Figure 15.Data structure 1500 is code elements.The code of any type can have phase constraint.Phase constraint 1502 is shown on the method 1504.Phase constraint 1502 is constrained in the operation of method 1504 stage of appointment in the phase constraint, is stage " execution " in the present embodiment.Thus, method 1504 is only carried out during son-stage in " execution " stage or " execution ".
In various embodiments of the present invention, data structure comprises the form of the constraint of the type that depends on component software and performed operation.In one embodiment, constraint is call constraint.Call constraint is constrained in specified phases with method call.Thus, the execution of the method in other component software or same component software is restrained by limiting these methods only to start during specified phases.In another embodiment, constraint is the constructor constraint.Constructor is the method for a kind of special shape of instantiation component software.Thus, the instantiation of component software is restrained to specified phases, such as what explain for the constructor-stage 1410 among Figure 14 A.In another embodiment, constraint is reference constraint.Reference constraint constrains the whole class of component software and such all primitive operations.For example, the reference constraint that docking port applies has limited the connection between the software module, such as what explain for the connexon-stage 1412 among Figure 14 A.
Constraint is expressed by the phase constraint attribute that can be assigned to any target software assembly in the software code.In various embodiments of the present invention, phase constraint attribute is assigned to whole class and is hereditable.Thus, child's assembly is inherited constraint from its parent component.In certain embodiments, scheme applies a plurality of phase constraint attribute to same target stage by stage.Thus, software object retrains by the combination of a plurality of phase constraint.
Each constraint is the constraint to " type " that is associated with the level in specified stage.Thus, the constraint of appointment superphase is the constraint to " superphase ".The constraint in the son-stage of appointment is the constraint to " son-stage ".To the constraint as the type in son-stage be to about " superclass type " the constraint of constrained union.Relation between the constraint of type is used or is used to check the validity of the restriction relation between the different software assembly when moving by compiler.
Implementing constraint can occur when operation or when compiling.When compiling, can check the constraint to type.Compiler can contrast be used to the combined method rule with the method (it calls the method that has the constraint of subtype) to the constraint of type and check to the constraint of type and to the constraint of subtype.If the constraint of subtype with identical to the constraint of type or than a little less than it, for example, if the slotting stage 1402 has been specified in the constraint of type, and has been specified initial beggar-stage 1414 to the constraint of subtype, should the constraint scheme be effective then.In this embodiment, initial beggar-phase constraint 1414 is in slotting interior execution of son-stages 1402, and therefore is the constraint a little less than.If to the constraint of subtype with the constraint of type is mutually disjointed, for example, if the constraint of type was specified with son-stage 1404, and opposite slotting son-stage 1402 has been specified in the constraint of subtype, then constraint scheme is invalid.If to the approximately beam intensity of the constraint of subtype comparison type or overlap, for example, if slotting son-stage 1402 has been specified in the constraint of type, and initial beggar-stage 1414 has been specified in the constraint of subtype, then constraint scheme is effectively, but must stand a certain dynamic chek.In this embodiment, if the operation in slotting son-stage 1402 and initial beggar-stage 1414 of current while of phase domain, then this invocation scheme is effective.Yet, if the territory not in one of two son-stages, this scheme is invalid.Other legitimacy rule is also conceived and is attached among the present invention.
Be used for multilayer stage by stage an exemplary embodiment of the method 1600 of territory operation computer environment shown in Figure 16 A and Figure 16 B.After beginning, conversion operations 1602 is transformed into the phase one, such as request stage 1202.In one embodiment, start such as main guidance devices such as main guidance devices 1102.In one embodiment, be restrained to one of main stage of main guidance device registration such as assembly 1104 assemblies such as grade.Main guidance device incipient stage clock is to cycle through logical time such as the stage in stage space 1200 stage spaces such as grade.
Determine that operation 1604 determines whether to be restrained in the main stage first such as any component softwares such as assemblies 1104.If a component software is restrained to the phase one, then executable operations 1606 is carried out this component software during the phase one.If do not have component software to carry out or component software the term of execution, determine that then operation 1608 determines whether the son-stage space that occurs during the phase one, such as son-stage space 1300.If there is not son-stage space to occur during the phase one, then this process advances to the conversion operations 1622 shown in Figure 16 B by connector 1.
If the son-stage space that occurs during the phase one is arranged, then sign operation 1610 identifies this son-stage space and applicable son-stages.In one embodiment, be activated such as son-guidance device 1106-guidance devices such as grade and register to the main guidance device of the main stage space of control.Son-guidance device begins son-phase logic clock to cycle through each the son-stage in son-stage space.Determine that operation 1612 determines whether to be restrained to any component software in current son-stage, such as assembly 1112.In one embodiment, be constrained in the component software of son-stage space to son-guidance device registration.Thus, under main phase domain, created nested son-phase domain.If in being constrained in the son-phase domain in current son-stage component software is arranged, then executable operations 1614 is carried out these component softwares during current son-stage.Determine that operation 1616 determines whether other the son-stage space that occurs during current son-stage, such as son- stage 1410,1412 and 1414.If other son-stage is arranged, then this process turns back to sign operation 1610 to identify other son-stage.
If there is not other son-stage space to identify, determine that then operation 1618 has determined whether that any other son-stage space is left to occur in current son-stage space.If there is another son-stage to occur in current son-stage space, then conversion operations 1620 is transformed into the next son-stage in son-stage space.In one embodiment, son-director waits until all threads in current son-stage are performed, then is transformed into next son-stage.Then, this process again advances to and determines operation 1612.If in not remaining any son-stage in current son-stage space, determine then operation 1618 determines whether another superphase that will be transformed into is arranged in any superphase space.If another superphase is arranged, then conversion operations 1620 is transformed into next superphase.This process (is determined the son-stage in the superphase; Executive software assembly within son-stage; Be transformed into next son-stage until all son-stages finish; And then be transformed into next superphase) repeat, until cycled through all son-stage spaces and requirement is transformed into next main stage.In case son-step cycle finished the first main stage, then this process advances to the conversion operations 1622 shown in Figure 16 B by connector 1.
Conversion operations 1622 is transformed into next main stage, such as update stage 1204.In one embodiment, all threads of carrying out in the phase one of main director waits finish.Then, main guidance device changes the logical stage clock into next stage.In certain embodiments, main guidance device is followed the above transformation rule of listing with reference to Figure 11.Similar operation when then this process is followed and occured as the phase one that is used for sign-stage.Thus, no longer discuss about some details of son-phase process herein, but person of skill in the art will appreciate that how will be implemented to about the details that the phase one describes in any subsequent process that is constrained in next stage.
Determine that operation 1624 has determined whether that any component software is restrained to the current main stage.If the component software that is restrained to next main stage is arranged, then executable operations 1626 is carried out this component software.In each embodiment, these component softwares are to main guidance device registration.These component softwares continue as the current generation and main guidance device is consulted.When phase transition and main guidance device reported that this territory is now in next main stage, the component software that is constrained in next main stage began to carry out.
If be not constrained in next main stage component software or the component software of constraint the term of execution, determine then operation 1628 determines in the current main stages whether any son-stage space is arranged.If son-stage space is arranged, then sign operation 1630 identifies these a little-stage spaces and is transformed into the first son-stage.Determine that operation 1632 has determined whether that any component software is constrained in current son-stage.If Constrained is in the component software in current son-stage, then executable operations 1634 is carried out this component software.
If be not constrained in current son-stage component software or these component softwares the term of execution, determine then operation 1636 determines in current son-stages whether other son-stage space is arranged.If other son-stage space is arranged, then this process turns back to sign operation 1630.If there is not other son-stage space in current son-stage, determine that then operation 1638 determines whether next son-stage in current son-stage space or next superphase in the superphase space.If next son-stage or superphase are arranged, then conversion operations 1640 is transformed into next son-stage or superphase.If under the current main stage, do not have next son-stage or superphase, determine that then operation 1642 has determined whether next main stage, such as reaffirming the stage 1206.If next main stage is arranged, then this process turns back to conversion operations 1622.If there is not another main stage in the main stage space, then this process turns back to conversion operations 1602 by connector 2 and circulates by being transformed into incipient stage phase one.
Be further to explain the present invention, be described in the exemplary computer system that multilayer operates in the territory stage by stage below with reference to Figure 17.This exemplary computer system operates individual contacts application, such as Microsoft_Outlook_ message communicating and collaboration client program.Herein, user interface shows the one or more contact persons in the address book.User interface has master view window 1702.Front view 1 702 shows the All Contacts and allows the user selection contact person to check more details about this contact person.
Computer environment 1700 operates under stage space.For unrestricted for the purpose of explaining, whole system 1700 is in 1200 times operations of stage space shown in Figure 12.In addition, for illustrative purposes, computer system 1700 is current to be in request stage 1202.Thus, computer system 1700 allows wherein to receive any operation of request or order.Thus, receive the user command 1716 of the detailed view 1704 check the contact person and being placed in the formation.In addition, order 1718 is sent to the details that address book module 1708 is asked with retrieval.Request of data 1718 also is queued.
Main guidance device 1102 changes the stage in the computer system domain 1700 into update stage 1204.Herein, order 1716 and 1718 is sent to respectively selection mode module 1706 and address book 1708.During update stage 1204, be transformed into as above and be used for user interface-stage space to the change of user interface with reference to what Figure 14 explained.Invalid son-stage begins.The order 1716 that is used for detailed view 1704 begins to process.View in the Front view 1 702 is disabled.For example, be set as inactive to the selection of detailed view 1704.In addition, Front view 1 702 is set as inactive window.Territory and user interface item that detailed view 1704 usefulness are suitable create.Then user interface-guidance device is transformed into drafting-stage.Drawn inactive to be revealed as to contact person's selection in the Front view 1 702, the selection that for example highlights changes color.Front view 1 702 is plotted as inactive.For example, Front view 1 702 panes change color to represent that it is inactive.Detailed view 1704 usefulness user interface elements are drawn.Field stays open with from address book module 1708 receive datas.
All in the user interface subspace of main guidance device 1102 are invalid finishes the stage of reaffirming 1206 that is transformed into afterwards with the drafting constraint manipulation.Executing data search operaqtion during reaffirming the stage 1206.In one embodiment, data retrieval operation is restrained to data retrieval-stage space.Data retrieval-stage space has two son-stages, i.e. mark and finally mark, and Figure 13 explains such as reference.Start mark-stage.Address book searches needs the software module of Data Update.Mark detailed view 1704.Be used for the son of data-guidance device retrieval to the son in final mark-stage-stage space conversion.In son-stage, address book 1708 is the required associated person information of retrieval from one of following three data storage: exchange server address book 1710, client address book 1712 or MSN address book at final mark.After retrieving associated person information, address book 1708 writes detailed view 1704 with associated person information.
After having finished all operations that is constrained in the stage of reaffirming 1206, main guidance device 1102 converts back request stage 1202.Herein, user interface again takes orders and asks from user input device.The user is in the change of detailed view 1704 interior inputs to associated person information.For example, the user changes contact person's address.Order 1720 sends to address book 1708 (original text 1704, mistake) to change data from detailed view 1704.In addition, order 1722 is sent to selection mode 1706 to upgrade the view of Front view 1 702 and detailed view 1704.In this embodiment, order will be queued, and main guidance device 1102 is transformed into update stage 1204.Update stage 1204 log-on datas are write son-stage space, such as son-stage space 1300.
In contract (agreement) son-stage 1302, address book changes request with data and sends to some data storages 1710,1712 and 1714.One or more copies that comprise the data that change in the detailed view 1704 in the data storage.Thus, each the data storage that has these data must agree to change data.Thus, during contract-stage 1302 voting process occurs.If all data stores agree are submitted this change to, then this contract is beamed back address book 1708.Son-guidance device will change in the stage to be submitted to or abort phase 1304.Herein, the data change is sent to the data storage and is used for more new data.
Simultaneously, during update stage 1204, user interface-stage space occurs.Selection mode 1706 will comprise the partial invalidity of legacy data in Front view 1 702 and the detailed view 1704 in invalid son-stage.In the son-stage of drafting, repaint Front view 1 702 and detailed view 1704, thereby data have for a change kept the space.After finishing in update stage 1204 in all son-stages, phase domain 1700 is transformed into the stage of reaffirming 1206.
Reaffirming in the stage 1206, other son-stage space comprises the son-stage for mark and final mark.Be transformed into marking phase, address book 1708 is labeled as the data that need change with Front view 1 702 and detailed view 1704.In son-stage, the data of change are written into Front view 1 702 and detailed view 1704 at final mark.These changes can occur within the very short time and with meticulous granularity.For example, the stage circulates in the moment of second after the user inputs each character and part.Thus, change appears to be immediately and occurs.
How this example shows intrasystem method carried out and applies multilayer and retrain stage by stage.If order and changing in the situation that do not occur stage by stage, then Front view 1 702 and detailed view 1704 may be updated before all data storages change data.Therefore, the user can be depending on attempt to change data and more the order of the new user interface method of attempting check and attempt in detail 1704 or the main mixing resultant of attempting in 1702.
Utilize the multithreading in concurrency territory
As above briefly describe, application program and/or application component can be restrained to moment or moment territory.According to various embodiments of the present invention, the assembly of software application can be divided into independent territory, is used for providing in the assembly subregion synchronously and thread isolation and be used for providing improved concurrent operations between the assembly subregion.Figure 18 shows an example system that is configured to carry out concomitantly a plurality of objects according to an embodiment of the invention.Example system 1800 comprises concurrency territory 1801, and it is all to be to carry out and the not directly set (or subregion) of (for example, synchronously) one or more single-threaded objects 1803 of communicating by letter with external object 1810 at single thread 1802.Internal thread 1802 is carried out object 1803 according to the logic that is applied by concurrency territory 1801.Internal thread 1802 is the single-threaded object 1803 in the execution concurrency territory 1801 only.Internal thread 1802 is not carried out any external object 1810.
According to an embodiment, same thread need not all to be used as internal thread 1802 between the whole lifetime in concurrency territory 1801.On the contrary, when not having the object requirement when internal thread 1802 is carried out, the thread that is used as internal thread 1802 can turn back to the thread pool (not shown).When again requiring a thread, can from thread pool, pull out a new thread to be used as internal thread 1802.According to another embodiment, one of single-threaded object 1803 has thread affinity (affinity), this means that single-threaded object 1803 need to carry out at same thread.In this embodiment, same thread is used as internal thread 1802 between the whole lifetime in concurrency territory 1801.According to an embodiment, less important thread 1804 discussed in detail also distributes from thread pool herein.
Still with reference to Figure 18, system 1800 also comprises at least one less important thread 1804 and at least one external object 1810.The embodiment of external object 1810 is included in any object of carrying out on one or more less important threads 1804.Less important thread 1804 comprises any thread except the internal thread 1802 of carrying out in the application program that is associated.As mentioned above, the example concurrency territory 1801 shown in Figure 18 comprises internal thread 1802 and a plurality of single-threaded object 1803.These single-threaded objects 1803 are only carried out with internal thread 1802.
Object 1803 in the concurrency territory 1801 is isolated with all the other less important threads 1804 and external object 1810 in the program.Any single-threaded object 1803 that less important thread 1804 does not comprise in the execution concurrency territory 1801.Each external object 1810 is configured to the one or more execution at less important thread 1804.External object 1810 is communicated by letter asynchronously with the single-threaded object 1803 in the concurrency territory 1801.Communication is included between the object transmits data or by the method for an object of another object reference (for example, or task).
Stride the asynchronous communication on 1801 borders, concurrency territory by realizing with border object 1807.Each concurrency territory 1801 is associated with one or more border objects 1807.These border objects 1807 can be illustrated as surrounding the barrier film in concurrency territory 1801 or the wall of band door.The example of border object 1807 comprises between the realization concurrency territory 1801 or data connector and the object of the custom protocol between concurrency territory 1801 and the external object 1810.
The one or more border objects 1807 of single-threaded object 1803 usefulness and external object 1810 asynchronous communications in the concurrency territory 1801.Single-threaded object 1803 usefulness internal thread 1802 are communicated by letter with border object 1807.Then border object 1807 communicates by letter with external object 1810 with one or more less important threads 1804.Border object 1807 is striden thus the border in concurrency territory 1801 and is come transmission of information and call.According to another embodiment, a border object 1807 was communicated by letter with another border object 1807 with less important thread 1804 before information is passed to external object 1810.
Border object 1807 is as the interface between each of the internal thread in concurrency territory 1801 and less important thread 1804.According to an embodiment, border object 1807 uses less important thread 1804 from external object 1810 reception of inbound communications, and will communicate by letter and filter to suitable internal object 1803.Herein with the more detailed description filter method.According to another embodiment, border object 1807 uses internally object 1803 reception outbound datas of internal thread 1802, and uses less important thread 1804 that this communication is sent to suitable external object 1810.According to an embodiment, border object can outwards call external object on internal thread, but the border object of doing like this is under the constraint.That is, allow border object outwards to call external object and must not can therefore cause limitless delay or deadlock.Another constraint prevents that external object from keeping the quoting of internal object, and this prevents externally directly reentering under the control of object of concurrency territory.
The thread that synchronous communication is carried out thereon at the first object enters second object and occurs when carrying out the method for second object.External object 1810 not with concurrency territory 1801 in 1803 synchronous communications of single-threaded object.Therefore, the less important thread of execution external object 1810 does not directly call or enters the single-threaded object 1803 in the concurrency territory 1801.
Figure 19 shows another mutual example system 1900 of concurrency territory wherein 1901 and external object 1910.An example of asynchronous communication externally illustrates between object 1910 and the internal object 1903.The border object 1907 that concurrency territory 1901 comprises internal thread 1902, is configured to the single-threaded object 1903 of carrying out in internal thread 1902 and is used for communicating by letter with external object 1910.Another embodiment of this system 1900 comprises a plurality of border objects 1907 and a plurality of single-threaded object 1903.
According to an embodiment, external object 1910 comprises the multithreading object 1905 that is configured in two or more less important threads 1904 execution.A part of 1905A of multithreading object 1905 is shown in the upper execution of a less important thread 1904A, and another less important thread 1904B is upper to be carried out and another part 1905B of multithreading object 1905 is shown in.According to another embodiment, external object 1910 comprises a plurality of multithreading objects 1905 or the single-threaded object (not shown) that is configured to less important thread 1904 execution.
Concurrency territory 1901 maintenance work formations 1908 in the system 1900.Work queue 1908 is (for example, the inserting) task of placing on it (for example, to the calling of the method for inner, single-threaded object 1903, Data Update and other executing method) and the multielement data structure that therefrom removes task.According to an embodiment, task is only to remove from work queue 1908 with their identical orders of layout; That is, retrain according to first in first out.According to another embodiment, the task of putting into work queue 1908 is assigned with priority, and each task removes according to its priority.
Import communication into and put into work queue 1908 by border object 1907.These communications of putting into have formed work item 1911, and they are to the request of the execution of the task of the inside that is associated with concurrency territory 1901, single-threaded object 1903 or border object 1907 (for example, enable or call).The request that forms work item 1911 can be sent to border object 1907 by external object 1910 or another border object 1907.For example, in Figure 19, the multithreading object 1905 request border objects 1907 of external object 1910 are executed the task, as being described by arrow 1920.Then border object 1907 will comprise that the work item 1911 of this task is put into the end of work queue 1908, as being described by arrow 1925.According to another embodiment, a plurality of border objects 1907 are associated with concurrency territory 1901, and one or more in these border objects 1907 can put into work queue 1908 with work item 1911.According to another embodiment, inner, single-threaded object 1903 request border objects 1907 are put into work queue 1908 tasks carrying is postponed till the time after a while with work item 1911.
According to an embodiment, in order to preserve resource when preparation is put into work queue 1908 with new task, whether any in border object 1907 inspection work queues 1908 and the definite work item 1911 of lining up comprises inter-related task.If inter-related task is arranged, then border object 1907 optionally bundles the inter-related task of new task with previous queuing as a subtask, but not new task is placed as brand-new work item 1911.
Still with reference to Figure 19, according to an embodiment, concurrency territory 1901 comprises allocator 1909, is used for tasking single-threaded object 1903 in 1911 minutes for processing from the work item of work queue 1908.Allocator 1909 usefulness internal thread 1902 are come to remove work item 1911 from work queue 1908, and assign each work item 1911 for carrying out in internal thread 1902.Allocator 1909 calls being included in the work item 1911 of task.For example, in Figure 19, allocator 1909 as by arrow 1930 with describing assignment from the work item 1911 of work queue 1908.Then as by arrow 1935 work item 1911 is carried out in internal thread 1902 with being described.
According to an embodiment, work item 1911 is put into work queue 1908 can not force allocator 1909 runnings.On the contrary, the execution of work item 1911 is postponed to the time point by the top layer circle logic defined in concurrency territory 1901.In case work item 1911 is placed into work queue 1908, internal thread 1902 is carried out the task of asking in such as next the suitable circulation by allocator 1909 determined concurrency territories 1901.Therefore, external object 1910 uncertain work item 1911 and the tasks of when calling and carrying out inside, single-threaded object 1903 therefore of when removing.When external object 1910 also uncertain border object 1907 executes the task in the internal thread 1902 in concurrency territory 1901.
In case assignment has also been finished task, the result that will set off passes to border object 1907 as callback.Then border object 1907 passes to this callback the external object 1910 that the work item 1911 of the task of realizing this result is called in initial placement.The example of callback comprises Data Labels that the indication task finishes, method call etc.
Figure 20 has described the asynchronous communication between inside, single-threaded object and the external object.According to one embodiment of present invention, show the communication chain 2000 that occurs during the externally asynchronous communication between object 2001 and inside, the single-threaded object 2009.External object 2001 at first communicates by letter 2002 with border object 2003.This communication 2002 is general adopts calling or the form of call request one or more tasks of being associated with concurrency territory (not shown).Although the task of asking is actually the task of single-threaded object 2009, external object 2001 only is associated this task with concurrency territory or border object 2003.
Then border object 2003 communicates by letter 2004 with work queue 2005.This communication 2004 generally comprises puts into work queue 2005 with the work item (not shown).Then work queue 2005 communicates by letter 2006 with allocator 2007.This communication 2006 generally comprises allocator 2007 and sequentially assigns each work item of putting into work queue 2005.At last, allocator 2007 communicates by letter 2008 with the invoked inside of its task, single-threaded object 2009.This communication 2008 generally comprises calling the task of inside, single-threaded object 2009.In another embodiment, external object 2001 is communicated by letter with another border object (not shown) in concurrency territory.
The above asynchronous communication of striding border, concurrency territory with reference to figure 18-20 description has protected inside, single-threaded object to exempt from the problem of reentering.As will be appreciated, object under the control in the item layer logic in concurrency territory (for example, inside, single-threaded object or border object) when the indication internal thread reentered same another object under this top layer logic control, reentering of internal control occured.When object (for example, external object) the indication internal thread under the control in the top layer logic in concurrency territory not reentered object under the control of this top layer logic, reentering of external control occured.When internal object reentered another object in himself or the same concurrency territory, inner reentering of causing occured.When the events affecting that is caused by external object when reentering, betide the control that will from the logic of common implementing the internal object in concurrency territory, effectively remove reentering that reenters that the outside causes.Right and wrong are deterministic as a result reenters.
Later with reference to Figure 19, that the asynchronous communication that only allows to stride the border in concurrency territory 1901 has been protected is inner, single-threaded object 1903 exempts from reentering of external control.For example, if execution inner, single-threaded object 1903 comprises calling the task of external object 1910, then internal thread 1902 will enter one of border object 1907 that is associated with concurrency territory 1902, and will call the task of the tasks carrying of being responsible for request external object 1910.Then internal thread 1902 turns back to the task of carrying out inner, single-threaded object 1903 or carries out the assignment from the work item 1911 of work queue 1908.Because internal thread 1902 is not left 1901 ground, concurrency territory and is entered external object 1910, so it does not drop under the control of external object 1910.
In addition, if allow internal thread 1902 to carry out the task of external object 1910, and if the execution of this task comprise the calling of another task of inner, single-threaded object 1903, then do not allow internal thread 1902 to reenter concurrency territory 1901.On the contrary, internal thread 1902 will enter the border object 1907 in concurrency territory 1901 to call the task of being responsible for placing work item 1911.Perhaps, as mentioned above, under some particular constraints, border object can outwards call external object with calling task on internal thread.After calling task, internal thread 1902 turns back to the task of carrying out external object 1910 and turns back to subsequently carries out first ancestral task inner, single-threaded object 1903.In other words, internal thread 1902 is not carried out calling of 1910 pairs of the second tasks of external object, until first task finishes, and until will so be done by allocator 1909 indications in concurrency territory 1901.
With reference now to Figure 21 and 22,, each embodiment that comprises the exemplary external object aspect of data source of the present invention has been described.Figure 21 shows the system 2100 that comprises concurrency territory 2101 and data source 2112, and Figure 22 shows the operational flowchart 2200 of the interface between the less important thread 2104 of the internal thread 2102 of describing concurrency territory 2101 and data source 2112.In one embodiment, less important thread 2104 comprises a plurality of less important threads 2104.Concurrency territory 2101 comprises single-threaded object 2103 and allocator 2109, and is associated with border object 2107.2101 maintenances of concurrency territory are indicated in the work queue 2108 of the task co-pending of internal thread 2102 execution in concurrency territory 2101.In one embodiment, data source 2112 is databases.In another embodiment, data source 2112 is networks.
The execution route of internal thread 2102 and less important thread 2104 is shown in two figure.In Figure 21, dotted arrow has been described the tasks carrying in internal thread 2102 generations, and solid arrow has been described the tasks carrying in one or more less important threads 2104 generations.The related label of dotted line and solid arrow is corresponding to about Figure 22 performed operation or task, and Figure 22 shows each task of arranging along this thread (task is performed on it).
Still with reference to Figure 21 and 22, the method begins at beginning frame 2201 places, and advances to operation 2202, and wherein single-threaded object 2103 request border objects 2107 call being associated with data source 2112 of task.This request is carried out in the internal thread 2102 in concurrency territory 2101.In operation 2203, allocator 2109 orders are by work queue 2108 and assign each work item 2111.According to an embodiment, assign these work item with internal thread 2102 with the order that work item 2111 is placed into work queue 2108.For example, allocator 2109 begins to put in order with work item 1 and finishes to put in order with work item 7, supposes and does not add in the meantime new work item 2111.Any new work item 2111 will be added after work item 7.According to another embodiment, work item 2111 is assigned according to the priority value that distributes.
Method 2202 is also led to method 2211, and the latter carries out simultaneously with operation 2202.In method 2211, border object 2107 calls being associated with data source 2112 of task.This is invoked at, and one of less important thread 2104 is upper to be carried out.Then, the method advances to operation 2212, wherein the task in executing data source 2112 on less important thread 2104 one or more.Then, operation 2213 comprises that database 2112 beams back border object 2107 with execution result as callback.Result's the one or more upper generation that is sent in less important thread 2104.Then, in operation 2214, border object 2107 is put into work queue 2108 with callback as work item 2111.This is placed on the one or more upper execution of less important thread 2104.
From operating 2214, the method advances to operation 2204.Operation 2203 also causes operating 2204.Operation 2204 occurs when allocator 2109 arrives the callback work item 2111 of being added by border object 2107 in operation 2214, this allocator work item 2111 in the execution work formation 2108 sequentially during operation 2203.Allocator 2109 usefulness internal thread 2102 are assigned callback.In case assigned callback, allocator 2109 continues each work item 2111 in the sequentially tell off formation 2108 in operation 2205.The method finishes at 2206 places.
With reference now to Figure 23 and 24,, each embodiment that comprises the exemplary external object aspect in less important concurrency territory of the present invention has been described.Figure 23 shows and comprises respectively the first and second concurrency territories 2301,2321 system 2300, and Figure 24 shows the wherein operational flowchart 2400 in the first concurrency territory 2301 and the second concurrency territory 2321 interfaces.Each concurrency territory 2301,2321 comprises respectively internal thread 2302,2322, single-threaded object 2303,2323 and allocator 2309,2329.Each concurrency territory 2301,2321 is associated with border object 2307,2327 respectively, and safeguards and indicate in internal thread 2302,2322 work item co-pending 2311 of carrying out, 2331 work queue 2308,2328.In Figure 23, first group of tasks carrying that dotted arrow has been described to occur in internal thread 2302, one group of solid arrow has been described the tasks carrying in one or more generations of less important thread 2304, and second group of tasks carrying that dotted arrow has been described to occur in the second internal thread 2322.These dotted lines and solid arrow are illustrated as carrying out related various operations in the communicating by letter between the first concurrency territory 2301 and the second concurrency territory 2321.These arrows related with reference to label corresponding to operation or the task carried out about Figure 24.
Still with reference to Figure 23 and 24, the method begins at beginning frame 2401 places, and advances to operation 2402 and 2422.The allocator 2329 usefulness internal thread 2322 that operation 2422 comprises the second concurrency territory 2321 are come each work item 2331 in the sequentially tell off formation 2328.Operation 2402 is carried out concomitantly with operation 2422.In operation 2402, the single-threaded object 2303 request border objects 2307 in the first concurrency territory 2301 call the task of one of the object in the second concurrency territory 2321.The task of asking in one embodiment, is the task of one of the single-threaded object 2323 in the second concurrency territory 2321.The task of asking in another embodiment, is the task of one of border object 2327 of being associated with the second concurrency territory 2321.
From operating 2402, the method advances to operation 2403 and 2412.In operation 2403, the allocator 2309 in the first concurrency territory 2301 is each work item 2311 in the tell off formation 2308 sequentially.In operation 2412, one or more in the less important thread 2304 of border object 2307 usefulness in the first concurrency territory 2301 communicate by letter with the border object 2327 in the second concurrency territory 2321.This communication comprises the request of calling task.Then, in operation 2413, the second boundary object 2327 is put into work queue 2328 with the task of asking as work item 2331.This placement is one or more being performed of using in the less important thread 2304.
Operation 2423 is all led in operation 2413 and operation 2422.In operation 2423, allocator 2329 arrival are also assigned the work item 2331 that comprises the task of asking.This assigns internal thread 2322 execution in the second concurrency territory 2321.Then, in operation 2424, task is as the callback of the single-threaded object 2303 in the first concurrency territory 2301 is carried out.At this moment, the method divides again, advances to operation 2425 and 2414.In operation 2425, allocator 2329 continues each work item 2331 in the sequentially tell off formation 2328.
Operation 2414 occurs concomitantly with operation 2425.In operation 2414, the one or more less important threads 2304 of border object 2327 usefulness in the second concurrency territory 2321 ask the border object 2307 in the first concurrency territory 2301 that callback is put into work queue 2308 as work item 2311.Then, in operation 2415, border object 2307 is put into work queue 2308 with this callback.This placement is to be performed the one or more of less important thread 2304.
The allocator 2309 of operation 2404 in the first concurrency territory 2301 occurs when arriving the callback of putting into work queue 2308.The internal thread 2302 in allocator 2309 usefulness the first concurrency territory 2301 is assigned callback.Callback is carried out in operation 2405.Then, the method advances to operation 2406, and wherein allocator 2309 continuation are assigned each work item 2311 according to the order of sequence sequentially by work queue 2308.The method finishes at 2406 places.
Another example (not shown) of system comprise interface each other and with the three or more concurrencies territory of external object interface.This system is according to sequentially operating with identical operation described herein.Each concurrency territory in this system comprises internal thread, one or more single-threaded object and allocator.Each concurrency territory is associated with at least one border object and safeguards a work queue.All communications of striding border, concurrency territory all are asynchronous (for example, filtering by corresponding border object, work queue and allocator).
The application program descriptive language
As above briefly describe, various embodiments of the present invention comprise application program description (XAD) and application program description (XAD) engine, are used for providing declarative rule and the description such as application program 304 all application programs such as grade and the assembly that comprise in the above application framework with reference to figure 3 descriptions.The each side of some embodiment relates to declarative or the descriptive language for the rule of creation data flow, data binding and sign application program.Other side relates to engine when processing or carrying out the operation of this declarative application program in when operation, and namely (via making up device) creates and check and/or " the application program description " of the object of deal with data.Therefore, the developer need not to write actual code for the object that carries out the data processing, but only need write the declarative application file that finally is compiled and carries out.As will be discussed in detail, this system provides numerous benefits of the art methods that is better than the application programs programming.
The use of this declarative language mode by data modeling, processing and conversion data, user interface (UI) and UI and the data interaction of declarative ground application programs is different from use to imperative language.Various embodiments of the present invention relate to for the certain claims language that characterizes XML application framework (XAF) application program.This declarative language is called as XAF application program definition (XAD) herein sometimes.Although great majority described herein realize that details relates to the use to XML, person of skill in the art will appreciate that and can realize each aspect of the present invention with other syntax.
As will be appreciated, for this separation between the configuration that the instance object that declarative application file and executing data process is provided, in one embodiment, can use a kind of platform, such as making up and the platform of executive utility etc.According to each aspect of the present invention, employed platform is called as the XAF platform herein, and it is for the platform that makes up and carry out these software applications.Especially, XAF also represents data uniformly with XML, and adopts the method for altitude module to make up each application program.In one embodiment, XAF has utilized XML that powerful data transformation ability and abundant data are provided.External data and Application Status all can use the ability of XML to visit and process.User interface and complex data flow process can define in XAD.
As described, XAD is a kind of declarative language for creation XAF application program.Figure 25 is senior the describing that the application program relevant with the data and target that is created to form executable application programs described.XAD be used for to create statement or describes such as data set or the application program of storing the data such as 2504,2506 and 2508 and describe 2502, so that when operation, assembly 2501,2512 and 2514 is created to process, checks and/or edits these data, thereby has constructed in essence the configuration that consists of the object of executive utility.
In the exemplary embodiment herein, application program is described 2502 and is expressed as one group of declarative structure, such as the good XML of form.Therefore application program is described 2502 and has been described one or more objects 2501,2512 and 2514 and should how to configure in executive utility.In essence, application program is described 2502 and is used for the configuration of computing application program and the result of nonusable routine, and the latter's calculating is finished by object 2510,2512 and 2514.Because object 2510,2512 and 2514 can be used by other application program of writing with non-declarative language, so XAD is by having improved the exploitation of application program to reusing of these objects.In addition, impossible mode application programs was carried out dynamic creation and modification when the XAD permission defined with traditional static declarative application program, will discuss in more detail as following.
For the data 2504 shown in Figure 25,2506 and 2508, these sources can be relevant with text data store, SQL database storage, XML source, web services source etc.In fact, application program is described 2502 and is considered to data-centered, so that it is data center.Application Status can be considered to another " data " source, and to treat with object 2510,2512 and 2514 the similar mode of more routine data that is configured on it operation.The developer therefore main pay close attention to the specific data flow process by the mode of application program and domination application program how in response to the rule of these data.XAD provides and has made up and the simple and cheap mode of change application program, and this is so that the target that can reach different software applications appropriate location (niche) and person's newly developed low complex degree is hindered.The application program of using the present invention for required protection to make up not only has traffic aggregate and transforms to the ability of application program, but also has selection to the ability of the optimal one or more user interfaces of data type.
Object 2510,2512 and 2514 expressions are by the assembly of good-decomposition, such as reader, editing machine, transducer etc.Application program is described and can be called " pre-programmed " assembly and/or add New Parent to set.
Object have by well-type of definition, therefore corresponding XAD label and parameter have corresponding type in the XAD language.XAD is strong typing, and the XAD compiler detects mistake statically.Label and parameter have return type and constraint base (cardinality constraints).In addition, data type is supported some additional constraints: scheme, conversion require and memory access availability (memory access is the strong typing object appearance (facade) for the XML data).
XAD not only allows simply to revise or increase existing application by changing one or more texts, but also the permission developer retrains modification and plug-in unit (can be added to the module of existing application, roughly be similar to browser plug-in) with the maintenance security, and following in greater detail user model is integrated.
Example XAD application program
For understanding numerous nuances of XAD, especially the XAD application program is described, and describes 2502 such as application program, an example will be discussed describe.Table 1 shows the source code of example XAD application program according to an embodiment of the invention.Example XAD application program in the table 1 is relatively simple, and has conceived many other complicated XAD application programs.In fact, the example shown in the table 1 has unique function of demonstration " Hello World " message.
Table 1: example XAD application program is described
As will be appreciated, the example shown in the table 1 comprises that some XML labels are to describe the object of deal with data gained.The 1st line identifier the version of XML, and the 2nd line identifier be used for the system label that the XAD application program is described, this will be in following more detailed description.The 3-4 line identifier some name space of available label among the XAF.For purposes of this discussion, the major part of the example in the table 1 is " Aplication (application program) " shown in eighth row label.Application tags is the example that causes creating an entity tag of application object when operation, the highest level of this application object coordinate application and controlling application program function.Similarly, " Window (the window) " label (another example of entity tag) in the 9th row causes window object, i.e. the establishment of the user interface entity of the framework of responsible display application program.In this case, " Window " is the parameter of " Application ".At last, " TextBlock (text block) " entity, the text object of the gained that namely creates as the result of the text label in the 10th row is the user interface entity of the responsible demonstration text (in this case, being " Hello World ") that creates when operation.Coming (via making up device) to create object with label will describe in more detail following.Above example only is provided to illustrate a simpler example XAD application program.
In operation, the XAD application program shown in compiling and the execution list 1 with create as application program, window and text object shown in Figure 26.That is, Figure 26 shows according to the application program of one particular embodiment of the present invention and describes 2602, is similar to the XAD application program shown in description shown in Figure 25 2502 and/or the table 1 when it is performed deal with data.
At first, the developer creates application program and describes 2602.In one embodiment, first label of XAD file 2602 is "<sys:XAD〉".Equally, for correctly operation, computer system can be such as XAF SDK visits XAF or any suitable equivalent by for example installing.After sending the application program launching order, XAD 2602 is by automatic Verification, and in one embodiment, is compiled into more effective form.2604 couples of XAD of compiler or XAF engine 2602 carry out grammatical analysis, and carry out being compiled of the necessary object of instantiation form.And engine 2604 creates subject component (being also referred to as entity) Figure 26 12,2614,2616,2618 and they is linked together to create the level of application 2606 of final deal with data.Simultaneously, engine 2604 is connected the data 2608 of each object with necessity, i.e. binding.Engine 2604 also can be considered to configuration service, because its instance object and object linked together to create application program 2606.
Application program 2606 is coupling assembling 2612,2614,2616,2618 figure.For example, application program 2606 can have one or more data connector entities 2612.Data connector entity 2612 sign with data be connected to system and with the object of available various data storing communications.The entity of another type relates to UI connector 2614.UI connector 2614 expression actual treatment user interface features, and the object of in fact communicating by letter with user interface 2620.Be included in also having usually in the conversion 2616 that information dissemination is provided certain conversion of data before the UI connector in the application program 2606, and deal with data is with the action 2618 of the action of execution such as a certain types such as Update Table.The process that creates necessary assembly and the more details that object binding arrived the process of data are below described.
As understanding from this discussion, the label that uses among the XAD 2602 is not used in the representative special object, but the XAD label represents object factory (factory).The description of object factory to be XAD in conjunction with its label makes up device class make to utilize in the label parameter of appointment makes up one or more entities.Engine 2604 provides the actual creation of these objects.In one embodiment, engine has the access to the Component Gallery 2622 of some details that existing and/or reusable label and object are provided.
Therefore, application program 2602 usefulness labels define, thereby allow the modular of application program.Figure 27 shows according to the structural mutual relationship between the assembly of this concept.Entity tag 2702 (entity tags shown in the 8th, 9 and 10 row of table 1) is associated with entity 2706.Making up device 2704 reads entity tag 2702 and shines upon it.Make up device 2704 instantiations and connect the one or more objects (not shown) that are associated with entity tag, and entity tag 2702 is associated with entity 2706.For the developer, appear to be entity tag 2702 and impliedly be mapped to its entity that is associated 2706, because mapping, instantiation, write or connection and initialization can occur on the backstage.
Had after these general provisions, will some details of XAD be discussed.About the more details of language, added the instructions as appendix A, it is by clearly in conjunction with in this manual.
Object and factory
Object comes instantiation by factory (factory), and factory makes up the device assembly, or the XAD engine that customizes with the fragment of XAD.Factory allows for such as lazy evaluation (lazy evaluation) or purposes such as virtual (saving need not the cost of the object of immediately instantiation) and postpones instantiation.This is to realize by the parameter with NewScope=" True " attribute.With conventional instantiation by sys:Switch structure together, factory makes it possible to the configuration of dynamic data related application.Dependence management in the XAF platform and the use of reaffirming are so that the XAD engine can reconfigure application program as required automatically when data change.This has eliminated and has conventionally write common in the application program and cost is higher and error-prone for the commanding demand that reconfigures code.The XAD engine allows to define factory with the XAD language, and the factory that structure is corresponding automatically realizes.
Framework label among the useful XAD comes the various objects of instantiation, all objects 2510,2512 and 2514 as shown in figure 25.A kind of such object relates to " data set provider " object that is also referred to as data connector, wherein source and the manipulation of the data that may use of data set provider object encoding application program.The data set provider object is connected to data source (by this data source, application program can receive external data) and data transformation (the logical OR arithmetical operation of carrying out importing data into).
Can use the framework label instantiation among the XAD another kind of type to as if user interface object.User interface object provides the function relevant with control display and input processing.User interface object can be used for trigger action (seeing action discussed below).
Also can use the framework label instantiation among the XAD another type to as if the action.Action provides " hook " (the appending to the function of user interface element) to the handle that is used for customer incident.For example, the button of clicking on the user interface will activate the action object that is associated with this button.
When customer incident occurs, can store and transmit event details with the action of correspondence.Event details can be stored on primary memory, hard disk drive or other storage medium.Event details uses " scope (scope) " discussed below variable to transmit.For example, click if customer incident is mouse, can mean that then the moment in this event stores x and the y position of mouse.Other details that can store when customer incident occurs includes but not limited to, supresses which key, selected which index of data element tabulation in the moment of this event, which row of form and/or row are visible etc. to the user when having selected which and/or row of form, moment in this event in the moment of this event.By using these events, can realize function of application.
Entity tag
Such as what can understand from the example as shown in the above table 1, XAD uses the use that comprises label.In one embodiment, a kind of label is " entity tag ".Other labels such as grouping or selector switch label will more discuss in detail following.Entity tag is mapped to (CLR) object between the common language runtime when operation.Unique restriction to the CLR object is that it must (in one embodiment) be the XAF entity.For becoming the XAF entity, the CLR object is from two base class, such as derivation in one of " Microsoft.Xaf.Core.BaseTypes.EntityElement " or " Microsoft.Xaf.Core.BaseTypes.EntityComposite ", and adhere to some agreement and the contract that is defined by XAF.
Make up device 2704 (Figure 27) and be responsible for the practical examples of entity, and sometimes be called as " label structure device " or " entity structure device ".In one embodiment, entity structure device is for the establishment entity and/or with entity user-defined .NET class connected to one another.Entity makes up device and is used for realizing primitive XAD label.In addition, entity makes up the interaction point between the self-defined expansion that device is engine 2604 and language, so that in one embodiment, the XAD language has defined the requirement that makes up device to writing entity especially.More details about label or entity structure device provide in the joint 3.5 of clear and definite combination appended appendix A in this manual.
The exemplary physical label illustrates at the 8th, 9 and 10 row of above table 1.For example, in eighth row, show the application entity label.As mentioned above, this label causes the instantiation of the entity of coordinate application, and the function of application of control highest level.Window entity tag (the 9th row of table 1) causes the establishment of the user interface entity of responsible display application program frame.At last, text entity tag (the 10th row of table 1) causes the responsible establishment that shows the user interface entity of text (in this case, being " Hello World ").As understood by the skilled person in the art, definable and many other entity types of use.
Before using the entity tags such as all application entity labels as shown in table 1, window entity tag or text entity tag, for example defining each entity tag in the XAF platform.In fact, each entity tag has corresponding label definition.The definition of each label has comprised is enough to the information that each entity tag the most at last is mapped to entity.Entity tag defines by the statement of form, and for example, " Text (text) " label is defined as follows beginning "<sys:TagDefinitaion Name=" Text " ...〉" ... and following end "</sys:TagDefinition〉".
What comprise in the definition is " title " of new label, such as " Text ", and " type " of special entity label.Entity tag can be classified into all kinds, and all entity tags all have type.But these types are supersets, and real CLR type corresponding to the entity that is associated with label.Some type of being used by the XAF framework comprises " sys:Data ", " sys:EventHandler ", " fwk:UIElement " and " sys:Selector ".Whether label adds framework or system to, depends on that usually whether label extracts in engine interface and/or the version internally with the speed identical with kernel language.If so, then label should be added to system, otherwise should be added to framework.Type statement in its definition.The Text definition that provides more than the continuation, the label definition can be expanded as shown in the following Table 2.
Table 2: comprise the definition to the Text entity tag of type
In table 2, the novel entities label of label definition indication Text by name should be created as type fwk:UIElement (the framework label of indication UI element type entity).The Text label can call the Anywhere use of fwk:UIElement entity subsequently.See in the HelloWorkd.xad example that an example of Text entity tag can occur in table 1.
Parametrization
Usually, each entity tag during the XAD application program is described has some parameter how description created, connects or configured object or the entity of gained.Parameter can be to the quoting of data, perhaps quoting factory or object.For example, range attribute can join to indicate this parameter to relate to factory or object with parameter correlation.If the object of a certain type of parameter request is just applicable, then this parameter can come mark to carry out the type consistency check with the type.This type checking guarantees that the execution of application program can not cause type mismatch, and the type mismatch meeting causes incorrect calculating.
XAD allows for the many different mode of entity statement parameter.A kind of common form is shown in the following table 3.
Table 3: with the example tag definition to the Text entity of parameter
At first, " Param " is the reserved name among the XAD embodiment, and is used for defined parameters.Equally, indicated such as the suspension points in the table 3, also one or more other parameters can be added to the definition of Text label.In this example, should create the novel entities of the type UI element of Text by name.In addition, should create the single parameter of " FontFamily (the font family) " by name of type " Data (data) " (more specifically, being " String Data (string data) ").The Text label of gained can with the static content string, as so that text be the Arial font "<sys:Text FontFamily=" Arial " .../" use together.Importantly, the label defined parameters is corresponding to having attribute in the practical examples of label of same names with this parameter.
Perhaps, label can be defined as getting the parameter of other entity, for example "<Text FontSize=" 25 "〉<foo:Random WordGenerator Param=" Text "/</Text〉".In one embodiment, above definition will make the Text attribute of Text label use the value of being returned by foo:Random WordGenerator function object, and present the value of gained on screen with 25 pounds font.In another embodiment, this definition can be written as "<TextFontSize=" 25 "〉<Text.Text<foo:Random WordGenerator/</Text.Text<Text ".A rear definition is instantiation Text entity, and with its Text attribute definition value that is foo:Random WordGenerator.
In one embodiment, parameter itself can comprise a plurality of its oneself entities.Table 4 shows code sample part parameters.
[0270]?
Table 4: example XAD segment parameters
Code shown in the table 4 (the 1st row) has defined the UI element of FlowPanel by name and has had some parameters, causes thus the demonstration of UI element flow.This group UI element that shows can be specified via the single parameter that is called " Children " of definition (the 2nd row) in the table 4.Namely the 2nd row shows the application program description of calling/describing the flow faceplate that defines in the 1st row.
Can specify a default parameters to each entity among the XAD.It is capable that table 5 shows the code sample that defines its default parameters that is called " Children ".If do not have the designated parameter name at subtab, then this subtab will join with this parameter correlation, and its DefaultParam (default parameters) attribute is set as " true ".
Table 5: default parameters example
Data binding
In one embodiment, XAD supported data binding (with the XML data binding to the object that is in particular this design data).Reference data more specifically when therefore, object oriented is used in designated parameter.Unlike quiescent value (according to definition, the life cycle of application programs keep constant), the data binding value can be upgraded by the modification to the associated data of data bound values.In one embodiment, this modification can be carried out by application program.In another embodiment, this modification can be carried out by user or external progress.In one exemplary embodiment, go "<TextText=" $ TextValue " FontSize=" 25 "/〉 " cause Text parameter value of being assigned with " $ TextValue ".In this embodiment, " $ " is reserved character, and use in this way this character the establishment of assembly be connected during the calling data binding.This data binding causes sensing or association from the data of another source that will be tied to this entity tag or object.
Data binding can be used for the citation digital data.That is, lteral data can be specified with the sys:InlineData label.For example, "<sys:InlineData Name=" TextValue "〉Hello Workd</sys:InlineData〉" defined an inline data, namely go here and there " Hello World ".This exemplary lteral data label is given title TextValue.Therefore, by use title $ TextValue in XAD describes, the XAD code can be tied to the data in the lteral data label, and the value of any parameter of type sys:Data is used it.
Data binding also can be used for quoting the relative data position.For example,<TextText=" $ SomeLocation/myd:Employees/myd:Employee/myd:Name "/〉 used dynamic prefix, i.e. " $ SomeLocation ", that relative data is quoted afterwards, i.e. " myd:Employees ", " myd:Employee " and " myd:Name ", and do not use " $ " character.The result is the data binding of absolute position that the value from the $ SomeLocation that is attached with given relative position is formed.
In addition, data binding can be used in conjunction with packet label.For example, the code sample in the table 6 (the 1st row) is tied to this group object under the Resources packet label with the MergeTreesTransform entity.
Table 6: to the data binding of packet label or action
Table 6 (the 2nd row) shows XAD and allows action is tied to data value.For example, to give a definition action is tied to the value of ScratchData.According to definition, the initial value of $ ScratchData is " Bye "." MouseLeftButtonDown " is the parameter of type " sys:EventHandler ".Running into left mouse button corresponding to the action of " MouseLeftButtonDown " parameter at the Text entity presses any moment of event and is called.This event is so that SetTextValueAction is called this general<Greeting〉textual value of element changes " Caio " into.Equally, right mouse button is pressed the value that event will cause $ ScratchData and is changed " Au Revoir " into.
In another example, data binding allows application program to receive command line parameter.For example, the code sample in the table 7 allows the specified command line parameter.The sys:Main label is the entrance of application program.
Table 7: command-line data binding
The application program of definition is accepted such as command line parameters such as " xad CommandLine.xad/TextData=Testing " in the table 7, and wherein CommandLine.xad is application name, and TextData is parameter name, and Testing is value.In one embodiment, can import a plurality of parameters into XAD with the form of " xad ApplicationName/ parameter name 1=value 1/ parameter name 2=value 2.../parameter name n=value n ".Use string as input value although those skilled in the art will appreciate that above exemplary embodiment, command line parameter can be alternatively or is additionally comprised alphanumeric values, filename, image or other resource location etc.Equally, command line parameter can be given a default value, for using not for this parameter specified command line parameter value the time.
The data source label
In one embodiment, external data is passed through the DataSource label display to the XAD application program.The latter in addition, can set up connection between application program and the XML file with the XmlFileDataSource label, so that can be employed program as data source.External data source can use by the mode that the inline data that is provided by the sys:InlineData label is provided.Yet external data source can use the XAD action to be saved in dish, and therefore other user can be when needed by this application program consumption to the change of data.
The definition of derivation label
XAD allow with the derivation label define to support to define abstract with reuse.For example, in the application program that requires a series of 12 pounds of Verdana font titles, the user can be with such as "<Text FontFamily=" Verdana " FontSize=" 12 " Text=" heading text here "/〉 " etc. definition be placed on the place, each position that requires title.Yet if require up to a hundred or thousands of titles, and each title may be different, derive the label definition and allow larger appointment efficient.More specifically, the definition of definable derivation label and an example are shown in the table 8.
Table 8: derive label definition example
Definition shown in the table 8 will be so that XAD creates the new label of the TitleText by name of type fwk:UIElement.Text parameter in this label is bound to the value that $ Text is imported into, and this value can differently be imported into each instantiation of title.
As another example, consider the following example shown in the table 9, wherein the first row is the sample segment of XAD, the second row shows derives the example that label defines to replace this XAD segment, and the third line shows the instantiation of using this derivations label to define and calls.
Table 9: exemplary fragment, derive the label definition, sample instance
As shown in table 9, derive label and can improve and repeatedly call or the functional and simplicity during the instantiation identical entry.
Scope and new range parameter
Range parameter provides the border of definition for some subgraph of the object that changes life cycle, the border of this definition especially is provided for the instantiation of the delay of these entities and/or repetition.Factory is postponement and postpones to call the means of instantiation.Value as the parameter that is provided by the entity that calls this instantiation is provided bound variable.An example to the use of bound variable is to allow to receive different event features, presses event such as mouse button.
XAD uses the new range parameter to transmit data between the application component, between the object and/or between its combination.In one embodiment, can with the new range parameter parameter be delivered to by parent component the sub-component of new establishment.Thus, XAD allows the user to take full advantage of code reuse.In one embodiment, constructed the tabulation entity of quoting that comprises the data in each list of entries.Definition will be done and so on same parameters to single list of entries and be applied to each new list of entries, thereby allows to create any large item list with single parameter or parameter set.In addition, the parameter of transmitting between father and son's object equally can be optimised.For example, parent object can pass to subobject with list index via the new range parameter, and described list index is corresponding to the list element that is passed to subobject.
The parameter of introducing new range is made as very (true) with " NewScope (new range) " attribute.For example, go "<sys:Param Name=" ... " NewScope=" true " .../" be generally used for new attribute is made as frame.The new range parameter can be used for the one or more variablees in the introducing scope.Variable is the parameter of implicit declaration.Variable is together with the statement of the new range parameter statement of coming together, as seen in can the example that (the 1st row) provides in table 10.As mentioned above, new range is introduced any entity that will be instantiated multiple times.Table 10 (the 2nd row) shows the definition to this factory:
Table 10: new range parameter
In above example (table 10, the 2nd row), had the bound variable of DataContext by name by the scope of RepeatedChild parameter introducing.This variable is set as the item corresponding to the sub-view of wanting instantiation.Above definition is used shown in table 11 (the 1st row), supposes that List.xml comprises the XML shown in the table 11 (the 2nd row).
Table 11: the example of bound variable is used
In the example shown in the table 11, to each list items, the FlowPanel entity will create the Text entity of a correspondence.The Flowpanel entity of gained will show at monitor the tabulation of employee (Employee) A-H.Those skilled in the art will appreciate that every delegation is corresponding to an instantiation of Text entity.What change between each instantiation is the value of " DataContext " bound variable.The pattern of gained is called as duplicator pattern (repeaterpattern).This is the basis of the iteration on the data set among the XAD.In one embodiment, the duplicator pattern can be nested to the multidigit iteration.
Additional parameter
Additional parameter is the parameter that is associated with subobject by parent object, and this subobject may not know how to process this parameter.For example, " triangle (triangle) " object as the subobject of father's " drawing (drawing) " object may specifically not know how to process " position (position) " coordinate, because position coordinates relates to the general position in drawing and is not specifically related to such as shapes such as triangles.Data and/or function that additional parameter allows the parent object access to be associated with subobject.XAD checks additional parameter correctly to use based on the definition of parameter described in the parent object.Table 12 (the 1st row) shows an example tag definition.
Table 12: additional parameter example
XAD code definition in the table 12 (the 1st row) has defined the entity that is called DockPanel, and it comprises the additional parameter that is called " Dock ", and this parameter can be called as " DockPanel.Dock ".Table 12 (the 2nd row) shows the exemplary XAD code that uses the DockPanel entity.
As shown in table 12, DockPanel.Dock is designated as the attribute of each Text entity, even DockPanel.Dock one of parameter of appointment in the label definition of Text entity not necessarily.Because DockPanel.Dock is additional parameter, it uses in conjunction with the Text entity, but in fact defines in the statement of the DockPanel entity shown in the table 12 (the 1st row).
Resource parameters
The parameter of another kind of type is resource parameters.Resource parameters provides the place that is stored in the object that does not have logical place in the object hierarchies.Resource parameters can be used for the set of any entity is anchored under the given entity.The action that is associated with resource parameters and state can run through whole application program to be used.An example definitions of resource parameters is shown in the table 13.
Table 13: example resources parameter
The UI element can be tied to state and/or action via the data binding ability of above-mentioned XAD.
Structure
In XAD, " structure " is a group object that can be used as a name delivery.Structure among the XAD also can be nested.The example of structure and nested structure is shown in the table 14.
Table 14: nested structure
In this example, $ ActionsAndData.Actions.Print and $ ActionsAndData.Actions.Save binding all is effective to all parameters of type sys:EventHandler.Similarly, $ ActionsAndData.RecentDocuments, $ ActionsAndData.Preference.User and $ ActionsAndData.Preferences.Enterprise are effective to all parameters of type sys:Data.$ ActionsAndData is effective to all parameters of signature (Signature) app:ActionsAndDataSignature.$ ActionsAndData.Actions is effective to all parameters of signature app:ActionsSignature.At last, $ ActionsAndData.Preferences is effective to all parameters of signature app:PreferencesSignatures.
Component list (manifest)
In one embodiment, XAD uses " component list " with the each several part of application program, such as the application program description collections together.Component list is can be by the appointment of the each side of the description application program of Computer Processing, needing between which file, the object to exist what dependence and what user environment exclusive data such as application program is the part (such as the user interface element text of user's native language, icon etc., different from the data of application program operation) of application program.
Built-in label
Built-in label is predefine and the label that significant capability is provided to XAD developer.It is conventionally, built-in that label is used " sys: " as prefix.For example, the establishment of these built-in label admissible condition operations, repetitive operation and object.A kind of built-in label of this type is called as " transaction " label, and it is used in the object what type the interior change of data description will use.Real time modifying is carried out in this permission configuration to object on screen.For example, in response to user selection one given user interface element, the function of this element and/or purposes can be changed in real time.For example, an output window can be used for showing from the arbitrarily output of different application view how based on the selection to " being recycled to next application view " user command.In one embodiment, the transaction label allows to carry out the transaction instantiation by bookmark name as shown in the following Table 15:
Table 15: the exemplary dynamic entity uses
In the example shown in the table 15, built-in entity " Dynamic Entity (transaction) " provides the ability of Dynamic Definition entity to the developer.In this case, $ DateTag is resolved to native name.
The built-in label that is called the another kind of type of " switching entity " allows dynamically to reconfigure application program by the condition of an object or a plurality of related objects is constructed.Although XAD is declarative language, it still has enough expressiveness to allow the condition structure to entity.Provide single structure to construct with enabled condition: Switch (switching).The switching entity label can come parametrization by " cases (situation) " or " conditions (condition) " label.Cases can be considered to be similar to the switch of C#, and Conditions is similar to the if-else clause of one group of C#.In one embodiment, be mutual exclusion to the use of Cases and Conditions, this means Switch can not be in its main body mixed C ases and Conditions.In addition, in the present embodiment, Cases may only use when parameter has been specified value for its Data (data) at Switch, otherwise must use Conditions.
Use Switch to allow the author as the result of switching evaluation is returned one or more entities conditionally.Table 16 shows some example XAD data (the 1st row), and the example of switching is used (the 2nd and 3 row).
Table 16: example resources parameter
As will be appreciated, the 2nd row of table 16 shows among the embodiment based on the syntax that creates entity greater than 50.00 dollars value.The 3rd row of table 16 further illustrates this example by the test block entity that illustrates for other condition test.The view of gained will show all elements item in the 1st row, i.e. " Toaster ", " VCR ", " DVD Player ", " Receiver " and " Sub-woofer ".Yet " Toaster " will be the Georgia bold and be green, and " Receiver " will be the Arial bold and be red.
Switching is followed the tracks of and is reaffirmed together with dependence and allows the automatic realization that dynamically reconfigures.Dynamically reconfigure and more to discuss in detail following.
The framework label
XAD and XAF allow to be called the label of the another kind of type of framework label (being abbreviated as " fwk ").The framework label can be used for creating the object as the part of application program.The framework label can be used for quoting action, data source, conversion and association manager (each comfortable following discussion).In one embodiment, the application program debugging also can be carried out via the framework label.
On the simplest rank, the UI connector provides visual XAF data and in response to the ability of the event of revising these data.In fact arbitrary specific UI connector has " element-tree " that a UI connector is presenting, one group of visual elements that can be shown.What be associated with each UI connector is that data-switching is become the code of visual elements and the code that event is converted to editing operation.
In one embodiment, the UI connector has been showed characteristic and the event of client platform (such as Windows_Presentation Foundation (WPF) element) simply.In addition, the UI connector provides the data binding of particular form, thereby will arrive the WPF element from the data binding of XAF data Layer.Different elements is designed to visual dissimilar data.For example, Image (image) element is visual by the demonstration data of bitmapped, the visual word string data of Text (text) element, and ListBox (list box) visual may be the ordered list of inhomogeneity data.Some element also can visual " selection " to these data such as ListBox and TextBox (text box).The concept of selecting is another data input basically.
Generally speaking, specific UI connector is designed to wanting visual specific type of data to work.If two elements have used identical mechanism to accept to be come by them the input (or parameter) of visual content, then the developer can write single UI connector and process the two.Parameter is used for giving factory's object to the UI connector, and the latter is used for creating as required subobject.The UI connector provides data context to factory usually.Factory is the fragment of XAD normally, and it is packaged in the object by the XAD engine.Table 17 shows one group of UI connector that can be provided.
Table 17: the built-in UI connector of example
One type framework label (being association manager) can be used for the element of an object with a data structure or data structure is associated.For example, the tabulation association manager can be used for an object with one the tabulation in the item be associated.The list items of gained will be dynamic, and this shows that it will comprise object and quote relative with quiescent value of associated data thereof.
In the operation
Figure 28 shows according to one embodiment of present invention by the operating process that makes up the operation that device carries out, and wherein creates and object is set for use.Instantiation process 2800 usefulness are carried out with creation operation 2802 beginnings and with the operating process that initialization operation 2806 finishes.Generally speaking, flow process 2800 can be carried out by single configuration service or by a plurality of services.
Creation operation 2802 creates object.In one embodiment, creation operation 2802 creates the required data structure of object.In another embodiment, creation operation 2802 is also by being required to be this data structure allocate memory.
In case creation operation 2802 has created object, attended operation 2804 namely is connected to other object according to the relation of this object and other object with this object.In one embodiment, make up the object create and the connection layout between one or more object that is pre-existing in.Establishment-connection-initialization sequence allows the XAD engine to support the circulation between the group objects to connect.In the situation that data and conversion, this circulation is forbidden, and the XAD compiler is carried out certain and checked to prevent this circulation.
The line that is produced by attended operation 2804 or connection layout have defined interconnection and the mutual relationship between the object.In one embodiment, these connections will keep, until change by dynamically reconfiguring (following discussion), or until object is deleted.Which connection is necessary to be determined when the executive utility marker code by engine.In one embodiment, attended operation 2804 is connected to application program with the data set provider object.
The object that initialization operation 2806 initialization create.In one embodiment, initialization relates to one or more uncertainty values is made as 0 or other predefine value.In another embodiment, initialization operation 2806 calls the constructor that is associated with object.In another embodiment, the object initialization that creates of initialization operation 2806 indication himself.Those skilled in the art will appreciate that initialization operation 2806 also can carry out other operation that usually is associated with object initialization and do not depart from the scope of the present invention.In one embodiment, whether initialization operation 2806 comprises based on given object and wants initialized data and occur conditionally.In one embodiment, object can come initialization with different value based on condition.For example, definition shown in the following table 16 will so that XAD when the price of article surpasses $ 500 with red display in tabulation, and if price be lower than $ 100 then show article with green.
Table 16: example XAD code
In one embodiment, engine uses instant (just-in-time) compiling to come executable operations 2802,2804 and 2806.In another embodiment, precompile application program.In another embodiment, realize the balance of performance and dirigibility with the combination of precompile and Just-In-Time.
XAD allows application program dynamically to be reconfigured.Dynamically reconfigure and to be triggered by the change of the data that flow into application program or the modification of the existing data of application programs.Figure 29 shows in the embodiment of XAD how dynamically to reconfigure application program.
Listener (listener) is the computing machine agency, and it monitors some event of application program or set of applications.The XAD listener monitors the change of the value of the data of some registered object in the XAD application program.Registration operation 2902 is to these listener registry object and data thereof.
When the change of data value occurs in registered object, by receiving the change notice of operation 2904 receptions from listener.Then marking operation 2906 identifies one or more data values of the value that depends on change, and they are labeled as to be subjected to change affect.Analysis operation 2908 is analyzed the value of change to the impact of the data value of each institute's mark.Based on the result of this analysis, determine that operation 2910 has determined whether that the reformed value of any object becomes invalid.
If it is invalid that one or more objects are changed to, then flow process is branched off into by "Yes" and removes operation 2912, and this operation removes one or more now invalid objects.Then flow process is branched off into determines operation 2914.If it is invalid to determine that operation 2910 determines not have object to be changed to, then flow process branches no to and determines operation 2914.
Whether the result who determines operation 2914 definite values as changing requires any new object.If require one or more new objects, then flow process is branched off into creation operation 2802 (Figure 28) by "Yes", and Object Creation, connection and initialization will as above be carried out in conjunction with Figure 28 describedly.Determine not look for novelty object if determine operation 2914, then flow process branches no to the end of exemplary flow.
Be the establishment of simplifying new object and the deletion of invalidated object, XAD can carry out lifetime management to object.Life cycle, the territory was the unit that reconfigures in the XAD application program.Its life span (is for example bundled each other, the first object in the situation that do not have second object to exist may be without any purposes, and second object in the situation that do not have the first object to exist may be without any purposes) object be placed in same life cycle of the territory.In the territory many objects can be arranged in given life cycle.When no longer requiring object, territory life cycle that all objects in the life cycle territory can will be deleted by reference (with forming contrast in order to delete the thousands of single object that may quote in the life cycle of the territory) easily deletes.Those skilled in the art will appreciate that the object in given life cycle of the territory need not be relevant in function; On the contrary, they only need to share creation-time and interdependent property, so that they can be discarded simultaneously.
What in one embodiment, XAD can be in conjunction with application program dynamically reconfigures to support the object that creates conditionally.The characteristic that therefore object of change type can be depending on the data value change creates.Figure 30 shows according to one embodiment of present invention the operating process of the operation of being carried out by creation operation 2802 (Figure 28).At first, determine that operation 3002 has determined whether that any label wants instantiation.If there is label to want instantiation, then flow process is branched off into by "Yes" and determines operation 3004.If there is not label to want instantiation, perhaps all labels all are instantiated, and then flow process branches no to attended operation 2804 (Figure 28).
Determine whether operation 3004 definite labels comprise any parameter of necessary instantiation.If there is no parameter tags, then flow process branches no to operation 3008.If there is parameter tags, then flow process is branched off into instantiation operation 3006 by "Yes".
Instantiation operation 3006 instantiations are by determining operation 3004 parameters that find.As mentioned above, parameter is used for describing how to create, connect or configure factory or object.As described earlier, parameter can comprise one or more characteristics of factory or object, to quoting of data or quoting another factory or object.Characteristic can be static or dynamic.
Process operation 3010 and process label according to its data type.There are some different types of labels, and realize several possible method by processing operation 3010 thus.Primitive label (actual label corresponding to an object) is to process by creating new object.In one embodiment, all objects that create are all corresponding to entity.
Some label range of definition border.These labels create " factory " so that process operation 3010, and factory can call in the after a while as required instantiation for entity.When processing plant, create a new scope territory.Usually can check its dependency information by entity, this information can be useful during dynamically reconfiguring.
Process operation 3010 and process switch labels by creating switching factory.This is a factory, and it supports the branch based on the application program controlling of various user's specified requirementss.This factory can be used for monitoring various conditions, will trigger the branch in the application flow when satisfying these conditions.In one embodiment, when owing to again process as the part that dynamically reconfigures label become must the time, Just-In-Time is used for revising object.
Process operation 3010 and also can process the label of other type.For example, binding tab triggers and processes operation 3010 establishment factories to indicate a certain parameter value to be actually quoting a certain other entity.This roughly is similar to the pointer in the procedural language.The binding of the delay of the entity that the permission of transaction label will create.When in one embodiment, this delayed binding is postponed to the application program operation.
After label had been processed in processing operation 3010, flow process turns back to determined operation 3002.
In one embodiment, can add plug-in unit (add_ins) to the XAD application program.Plug-in unit is can expand the essential characteristic collection of given application program and the self-contained software package that need not upgrade applications.But plug-in unit allows incrementally to add them in new feature or third party's expansion time spent that becomes, and need not to experience may be expensive the upgrading circulation.
The XAD plug-in unit is packetized in the subassembly (assembly).In one embodiment, subassembly loads by the static dependencies item of appointment in the component list (above discussing).In one embodiment, the XAD application program is communicated by letter with plug-in unit via the extensibility agreement.The extensibility agreement can define in independent subassembly, so that this agreement can be issued simultaneously and quote with the third party that can develop this expansion by application program.
The extensibility agreement has two parts.First is metadata (Metadata) scheme.Metadata is the data of data of description.In the context of XAD, metadata can be used for describing the feature that is realized by plug-in unit.Metadata can comprise the mankind of bookmark name, the parameter that will transmit, UI-readable text etc.Extensible application has defined metadata proposal (desired from plug-in unit), and plug-in unit provides content.The second portion of extensibility agreement is label signature (above discussion).Plug-in unit is realized its feature by the definition label.Application program uses these labels to visit the plug-in unit feature.Application program definition label signature (label should cause the entity of what type, label should get what parameter etc.), and plug-in unit provides label definition (bookmark name and actual the realization).Therefore the label signature roughly is similar to interface, and the label definition roughly is similar to Interface realization.
In one embodiment, XAD supports and can set via the global metadata of metadata tag access.Metadata tree is the associating from all metadata composition files of the subassembly of all dynamic load.When operation, metadata tree was automatically updated in any moment that load or unload has the subassembly of metadata composition file.Send suitable change notice, so that application program is dynamically upgraded himself (as before discussing in conjunction with Figure 29).Metadata tree allows application discovery will load what plug-in unit, and the feature of utilizing plug-in unit to provide.
In one embodiment, plug-in unit has defined the label of the feature that realizes for the access plug-in unit.Because plug-in unit may be disabled when writing application program, so the label by the plug-in unit definition possibly can't be known and use to application author.The author may only know, and therefore may only define statically the label signature.Physical tags title and final parameter value can be provided with metadata by plug-in unit.Because metadata proposal is the part of the extensibility agreement of application program definition, so metadata proposal information can be by application access.Therefore application program can read metadata, and comes dynamically instantiation entity according to bookmark name.XAD supports to be used for the DynamicEntity label of this purpose.
Although in language, clearly the present invention has been described in the action of architectural feature, method and the computer-readable medium that comprises these actions, but be appreciated that the present invention who defines in the appended claims is not necessarily limited to described concrete structure, action or medium.It should be appreciated by those skilled in the art that other embodiment or the improvement that fall within the scope and spirit of the present invention.Therefore, these concrete structures, action or medium are disclosed as the exemplary embodiment that realizes the present invention for required protection.The present invention is defined by appended claims.
Appendix A
Content
1. introduction ... ... ... ... ... ... ... ... ... .71
1.1 XAF principle ... ... ... ... ... ... ... ... ..71
1.2 XAF target ... ... ... ... ... ... ... ... ..71
1.3 the role of XAF application structure and XAD ... ... ... ... ... .72
1.4 norm structure ... ... ... ... ... ... ... ... .73
1.5 standard agreement ... ... ... ... ... ... ... ... .74
2. language concept ... ... ... ... ... ... ... ... ... 74
2.1 Hello World example ... ... ... ... ... ... ... .74
2.2 case sensitivity ... ... ... ... ... ... ... ... .75
2.3 entity tag ... ... ... ... ... ... ... ... ..76
2.4 the basic parameter of entity ... ... ... ... ... ... ... 78
2.4.1 the parametrization with static string ... ... ... ... ... ... 78
2.4.2 the parametrization with the odd number entity ... ... ... ... ... ... .79
2.4.3 the parametrization with group of entities ... ... ... ... ... ... 81
2.4.4 resource ... ... ... ... ... ... ... ... 83
2.4.5 default parameters ... ... ... ... ... ... ... ..83
2.4.6 additional parameter ... ... ... ... ... ... ... ..85
2.4.7 inline data ... ... ... ... ... ... ... ..87
2.5 by the binding parametrization ... ... ... ... ... ... ... ..88
2.5.1 the name of label ... ... ... ... ... ... ... 88
2.5.2 be tied to entity ... ... ... ... ... ... ... 89
2.5.3 be tied to packet label ... ... ... ... ... ... ..94
2.5.4 be tied to the formal parameter of label definition ... ... ... ... ... .95
2.5.5 allow editor with binding ... ... ... ... ... ... .97
2.6 main label ... ... ... ... ... ... ... ... ... .99
2.6.1 automatic filling parameter ... ... ... ... ... ... ... .99
2.6.2 command line parameter ... ... ... ... ... ... ... 101
2.7 the piece of ignoring ... ... ... ... ... ... ... ... .102
2.8 the parameter of spreading out of ... ... ... ... ... ... ... ... .106
2.9 white space ... ... ... ... ... ... ... ... ... 106
2.10 structure ... ... ... ... ... ... ... ... ... .107
2.10.1 single layer structure ... ... ... ... ... ... ... .108
2.10.2 nested structure ... ... ... ... ... ... ... .110
2.11 pattern ... ... ... ... ... ... ... ... ... .111
2.11.1 be used for the pattern of acquiescence purpose ... ... ... ... ... ... 112
2.11.2 the pattern of the Visual tree of Avalon ... ... ... ... ... .115
2.11.3 pattern and visual trigger ... ... ... ... ... ... 116
2.12 the parameter of setting range ... ... ... ... ... ... ... 116
2.12.1 bound variable ... ... ... ... ... ... ... .116
2.12.2 duplicator pattern ... ... ... ... ... ... ... ..119
2.12.3 the bound restriction that scope is relevant ... ... ... ... ... ... 122
2.12.4 nested duplicator pattern ... ... ... ... ... ... ..123
2.13 parameter is inherited ... ... ... ... ... ... ... ... 127
2.13.1 restriction ... ... ... ... ... ... ... ... ..128
2.14 conditional parameter ... ... ... ... ... ... ... ... .129
2.14.1Case...............................................130
2.14.2Condition..........................................131
2.14.3SwitchEntity.......................................131
2.14.4SwitchEntities.....................................133
2.14.5 summary ... ... ... ... ... ... ... ... ..134
2.14.6 selector switch and label definition ... ... ... ... ... ... ..136
It is 2.15 related ... ... ... ... ... ... ... ... ... .138
2.16 label documentation ... ... ... ... ... ... ... ..140
3. formal language standard ... ... ... ... ... ... ... ... ... 141
3.1 boolean properties ... ... ... ... ... ... ... ... .141
3.2 qualified name ... ... ... ... ... ... ... ... ... 141
3.3 key word ... ... ... ... ... ... ... ... ... 142
3.3.1<Xad>...............................................142
3.3.2<Doc>...............................................142
3.3.3<Description>.......................................143
3.3.4<Type>.........................................143
3.3.5<TagDefinition>................................144
3.3.6<Signature>....................................145
3.3.7<ParamGroup〉(<Xad〉under) ... ... ... ... ..145
3.3.8<Const>........................................146
3.3.9<Param>........................................146
3.3.10<OutParam>....................................147
3.3.11<ParamGroup〉(<Choice〉under) ... ... ... ... .148
3.3.12<ParamGroupRef>...............................148
3.3.13<Choice>......................................149
3.3.14<ParamDefaultValue>...........................149
3.3.15<ConstDefaultValue>...........................149
3.3.16<Entity>......................................149
3.3.17<Function>....................................150
3.3.18<Body>........................................150
3.3.19<ScopeVariable>...............................150
3.3.20<AttachedParam>...............................151
3.4 built-in entity ... ... ... ... ... ... ... ... 152
3.4.1<InlineData>...................................152
3.4.2<Binding>......................................152
3.4.3<XPath>........................................153
3.4.4<Mapping>......................................153
3.4.5<DynamicEntity>................................153
3.4.6<AssociatedEntity>.............................154
3.4.7<AssociatedDataEntities>.......................154
3.4.8<SwitchEntity>.................................156
3.4.9<SwitchEntities>...............................156
3.4.10<Case>........................................157
3.4.11<Condition>...................................157
3.5 entity makes up device ... ... ... ... ... ... ... .157
3.6 action ... ... ... ... ... ... ... ... .160
4. common framework entity ... ... ... ... ... ... ... ... ... 162
5. deployment model ... ... ... ... ... ... ... ... ... .162
5.1XAD application program ... ... ... ... ... ... ... ... ..162
5.2XAD subassembly ... ... ... ... ... ... ... ... .163
5.3 subassembly component list ... ... ... ... ... ... ... ..165
5.3.1 component list label ... ... ... ... ... ... ... .166
5.3.2 exemplary components inventory ... ... ... ... ... ... ... .167
5.4 subassembly dependence ... ... ... ... ... ... ... ... .169
5.5 subassembly binding, loading and unloading ... ... ... ... ... ... 170
5.6 packing situation ... ... ... ... ... ... ... ... ..171
5.6.1 monofile application program ... ... ... ... ... ... ..171
5.6.2 derive the storehouse of label ... ... ... ... ... ... ... .172
5.6.3 the storehouse of primitive label ... ... ... ... ... ... ... .176
6. plug-in model ... ... ... ... ... ... ... ... ... .179
6.1 what is plug-in unit? ... ... ... ... ... ... ... ... .179
6.2XAD plug-in model ... ... ... ... ... ... ... ... ..179
6.2.1 the dynamic load of subassembly ... ... ... ... ... ... 180
6.2.2 the extensibility agreement of metadata-driving ... ... ... ... ... 180
6.2.3 transaction instantiation ... ... ... ... ... ... ..181
6.3 plug-in unit situation ... ... ... ... ... ... ... ... ..181
6.3.1FileExtensionProtocol subassembly ... ... ... ... .182
6.3.2File subassembly ... ... ... ... ... ... ... 184
6.3.3SmartFilesAddIn subassembly ... ... ... ... ... .186
7. appendix A: code is write agreement ... ... ... ... ... ... ... ..187
7.1 be used for " sys " prefix of System name space ... ... ... ... ... 188
7.2 the Pascal external packing of name ... ... ... ... ... ... ... .188
7.3 the signature name must finish with " Signature " ... ... ... ... ... 188
7.4 the name of " Set " parameter must finish with " s " ... ... ... ... ..188
7.5 the name of " Singular " entity tag must not finish with " s " ... ... ... 188
7.6 the name of selector switch label must finish with " Selector " ... ... ... ..188
7.7Param (if appointment) must be first attribute of entity ... ... ... ... 188
7.8Name (if appointment) must be Param (if appointment) first attribute afterwards of entity ... ... ... ... ... ... ... ... ... ... 188
1. introduction
XAD (definition of XAF application program) is a kind of declarative language that is used for making the XAF application program.
The UI combined aspects of XAD is identical with XAML as much as possible.The further feature great majority that XAD supports are towards the data binding feature of XAF platform.
Although XAD can represent with multiple format, it mainly represents it is with Xml's.This allows the strong engagement with XAML.Another advantage of using Xml is that the inherent data that XAD resolver and XAD developing instrument can directly be processed XAF represents (Xml).
XAD is " through what translate " with regard to XAD developer need not to carry out any explicit compile step.This does not get rid of some compilings of carrying out on " jit compiling " backstage for performance reason.
1.1XAF principle
XAF is for the platform of setting up " office's class " application program of going on the market with the time of greatly reduction.The core principles of XAF is:
Xml is represented as uniform data
It is the method for setting up a kind of altitude module of application program
Powerful data-switching ability
With the enrich assembled view of Avalon as the basic representation layer
1.2XAF target
Because XAD is used to make the XAF application program, so the target of XAD is set up based on core XAF principle:
Xml is represented as the uniform data of external data and Application Status
Seamless and data binding (Xml by non-Xml data source represents) with Xml and non-Xml data source
The declarative definition of complex data stream
Use 1) with the class XAML grammer or 2 of binding additional data structure) XAML itself is to the declarative definition of UI
How data carry out conversion, demonstration and mutual rule-based declarative definition
Strong typing and senior static check
Senior expansion with minimum " built-in " set of keywords
Progressive abstraction level
Enough abundant to specify " office's class " application program with regard to following aspect
The ο breadth and depth
The ο performance
The ο quality
1.3XAF the role of application structure and XAD
The XAF application program is to make up with the technology that is different from traditional window application programming technique.
Most of existing window application development technique depend on the developer and write the execution stream that code comes controlling application program.Developing instrument can comprise with the declarative mode and designs dialog box and UI pel, but the developer finally is responsible for carrying out the viewable design program of stream.The developer must write button.onrelease and the data structure of processing Application Status.The developer also is in charge of the mapping between data structure and their visual elements of expression.All these comprises the differ from one another commanding application code of (although similar bottom pattern is arranged) of each a large amount of application programs.
XAF has adopted a kind of method of different creation application program.Data, user interface and the UI of XAF declarative ground application programs and the Method Modeling of data interaction.The core design principle is view-data separating.The XAF application program can be considered as mainly is declarative, but has inserted as required commanding code segment.
The XAF application program is considered to data-centered; Except application program was data-centered, all Application Status also were regarded as data.Developer's major concern be that data stream is crossed the method for application program and the rule how the management application program responds to data.The practical basis structure that is used for data binding is not that the developer is concerned about, and is provided outside by XAF.
1.4 norm structure
Although a part of back chapters and sections in this standard can be used as skilled XAD author's independently reference, generally speaking these chapters and sections interdepend and set up.
2. language concept:By normal codes sample explanation kernel language concept and structure.Although language key word and general framework label use in sample in a large number, but their only in the back form ground definition in the chapters and sections.
3. formal language standard:The formal definition of all language keywords (language keyword can be considered to be " built-in " label in language).This section also comprises the formal definition of XAD extensible mechanism (being the label of third party's definable its oneself).
4. common framework entity:The most frequently used label that discussion is provided by standard x AD framework.These are the labels that can be used by the third party extensible mechanism structure of XAD.The framework label helps with recommending Design Mode and best practices to come the Structural application program.
5. deployment model:Formal definition and the exemplary discussion based on subassembly-deployment model of XAD.
6. plug-in model:How the XAD deployment model can be used as the illustrative discussion of the declarative models of specific plug-in.
Appendix A: code is write agreement:The XAD code of suggestion is write the tabulation of agreement.The XAD framework of standard meets these agreements.The third party can select to adopt the part or all of of these agreements.
1.5 standard agreement
In XAD, use name space fully and Xml name space standard (http://www.w3.org/TR/REC-xml-names/) compatibility of W3C.This standard is used specific unified name space agreement in all code sample.
The label of all bands " sys " prefix all is the label that occupy in " XAD system " name space.Label in the system namespace is embedded in the language and can be regarded as the language reserved keyword.
The default names space of all code sample is " XAD standard card cages ".In this standard, all do not have the label of name space prefix all can be identified as to belong to standard card cage.In other situation, provide the fwk name space, and the fwk name space should be associated with the label that belongs to the XAD standard card cage.
All code sample all in compliance with
Appendix AIn coding convention.
2. language concept
This section illustrates core XAD language concept and structure by the normal codes sample.Larger code sample with more comprehensive situation will be provided in the chapters and sections in the back.Although language key word and general framework label use in sample in a large number, but their only in the back formal definitions in the chapters and sections.
2.1Hello World example
The XAD code is the good Xml of form always.First label of XAD file is needed as<sys.Xad 〉.This document usually (but and nonessential) has the .xad extension name.
HelloWorld.xad:
After XAF SDK has been installed, " xad.exe HelloWorld.xad " will cause this simple application program implementation.The XAD code there is not explicit compile step.Automatic Verification when XAD carries out for the first time at the XAD code (and may compile, although this can't carry out current).The XAD of verification step failure can not move, until necessary code error is repaired.
It below is the screenshot capture of HelloWorld.xad application program.
Use is catered to the XAD sample of this concept in problem each language concept was discussed originally.The fundamental purpose that lists the HelloWorld example provides certain class relevant with the XAD outward appearance basically hereinafter.
2.2 case sensitivity
Write as following:
With write as following:
<text>
Different.
2.3 entity tag
Be not all labels among the XAD all be entity tag (have two classes to be called other label of " packet label " and " selector switch label "---they are the minor changes that are discussed later the entity tag of middle definition).Yet entity tag is the XAD label of the most common and most important kind.
In order to become an XAF label, the CLR object is necessary:
● derive from one of following two base class:
○Microsoft.Xaf.Core.BaseTypes.EntityElement
○Microsoft.Xaf.Core.BaseTypes.EntityComposite
● be attached to
Http:// xafteam/xafenv/doc/Platform/CoreComponents/Dev/DevIntroT oEntityDomains.docThe specific protocol of middle definition and contract.
It is to be responsible for the practical examples of entity (factory mode) and the parameterized class of entity that label makes up the device class.This label makes up device and is actually only to the interested realization details of framework extender.
3 entity tags (Application, Window and Text) are arranged in Hello World sample:
Each of these three entity tags causes creating an entity when executive utility.
● the Application entity is " coordination " application program and the root level entity of controlling top level view.
● Window is the UI entity of being responsible for the display application program frame.
● Text is the UI entity of being responsible for showing text (being " Hello World " in this case).
Entity tag defines by the statement form, begins shown in for example the Text label is defined as follows:
Entity tag can be divided into all kinds.But these types are supersets and in fact corresponding to the CLR type of the entity that is associated with label.Some examples of the type of being used by standard card cage in a large number are sys:
DataSys:
EventHandler, fwk:UIElement and Sys:Selector.
Generally speaking, label is added to differentiation between Framework or the System name control based on following criterion:
1. if:
A. label is signed and issued by the internal engine interface,
B. version has the progress identical with kernel language and then adds System to
2. if:
A. can't help the internal engine interface and sign and issue,
B. version does not have the progress identical with kernel language and then adds Framework to
The statement in its definition of the type of entity then is the Text label, and its type is specified as follows in its label definition:
2.4 the basic parameter of entity
In the chapters and sections, we determine that entity tag causes object (more specifically XAF entity) to create when operation in front.Yet for useful object, it needs certain significant parametrization.
This section covers the parametrization of the citation form of XAD entity.
2012304245230
[0606]XAD allows many distinct methods of statement substance parameter.A kind of common form is:
This statement indication Text entity has type for " Data ", more specifically be the parameter of " Text " by name of " String Data ".
The practical examples of Text entity seems to be similar to:
In a rear joint, will introduce<sys:InlineData how label and will discussing can express with " ./", " " static state string that begin or that be ". " fully.
2.4.2 the parametrization with the odd number entity
In the example in front, choice for use hard coded string or static string are specified the text of Text UI element.Might change into the entity that produces string and come parametrization Text element.Consider to produce the random words connector entity of random train:
(statement of listing random type family (Random Font Family) mainly is that the corresponding Type attribute for the FontFamily parameter of emphasizing Type attribute and Text is complementary.)
FontFamily with another substance parameter seems to be similar to:
This can be pronounced " with the effective FontFamily parameter of random type family entity as the Text entity ".
This has only hinted that user's defined parameters can not be named as " Param ".It is illegal being write as following:
In order to understand better with the parametrization of other entity to entity, consider in the entity layering structure, to have the following example of an additional layer:
Xml File Data Source entity comes parametrization with the title of the Xml file that comprises a numerical listing.The FileConnector entity can be regarded as having produced a numerical listing.Highest Value Transform comes parametrization with a tabulation (being provided by Xml File Data Source) in this situation.
Highest Value Transform produces tabulation with mxm.-item.Then, the Text element is used by the tabulation of Highest Value Transform generation-item and is come parametrization (as long as the type of this list items is that sys:Data and target type are fwk:String, it just can be consumed by Text).
Following diagram helps to illustrate the nested data stream in this generation:
The method that another kind is write is not use the Param attribute; This is easier to understand usually:
As appreciable from above Xad, use the Param syntax to make the Xad application program can be more simple and clear.Yet using this grammer is pattern and the problem of NOT-function.
2.4.3 the parametrization with group of entities
What pay close attention to up to now all is the odd number parametrization.The odd number parameter is the parameter of getting at most an entity.Yet the parameter that an above entity is got in statement is possible.Consider:
Hint such as its title, FlowPanel (streaming panel) element shows the stream of UI element.The explicit UI element set that will " flow " can be specified by " Children " (child's) by name parameter.
The FlowPanel example can be designated as:
The group of entities of appointment is corresponding to " Children " parameter of FlowPanel under the FlowPanel.Childen packet label.
The gained diagram seems to be similar to:
Chris?Hackmann
Vlado?Hristov
William?Aitken
If only specified a sub-UI element for a FlowPanel, then write as following still effective:
Noting, is effectively (to need only and only specify an entity) " Param " for the parameter of getting group:
Below also be effective:
It also is possible being write as following
Using XQuery is effectively, because it is used as the value (by Param=" FlowOrientation " expression) of the FlowOrientation parameter of FlowPanel.If Param=" ... " is removed, then this can become invalid Xad.
2.4.4 resource
Existence obtains the special parameter that is called " Resources " that implicit expression is supported at all entities.Sole exception is the sys:InlineData that does not support Resources.The Resources parameter is used to any group of entities is anchored under the given entity.
The Resources parameter usually is used as " grab bag " of action and state in the superlative degree of application program.Then these actions and state use in whole application program, for example:
The method that the UI element is tied to state and/or action will become apparent when XAD binding structure is discussed." Name " attribute of relevant data connector and action also will illustrate in the context of binding.
2.4.5 default parameters
The method of the two kinds of designated parameter among the XAD of having touched upon up to now; Use " Param " attribute and use packet label.Yet Hello World sample neither uses:
Reason is that Hello World sample depends on " default parameters ".It can be rewritten as follows:
The label definition of application program comprises similar following delegation:
Recall above FlowPanel example:
This need not packet label (being FlowPanel.Children) and just can rewrite, because be designated as default parameters for FlowPanel entity " Children ":
2.4.6 additional parameter
We determine how entity can state a closed parameter group up to now.Consider now following XAD fragment:
It is as follows that the gained view seems that some is similar to:
The Text entity is designated as " Children " parameter of DockPanel (stop panel) entity.
Recall: do not need packet label, because Children is the default parameters of DockPanel entity.
Note, what is interesting is that " DockPanel.Dock " is designated as the attribute of each Text entity.Yet " DockPanel.Dock " is not to one of parameter of Text entity appointment in label definition.
Recall: up to now, the example of label only can use the attribute that is defined as parameter in its respective labels definition.
" DockPanel.Dock " is an example of additional parameter.In fact, it defines when statement DockPanel entity:
In other words, for each the UI element that is designated as a Children parameter part, might specify the additional parameter of DockPanel.Dock by name.
The technical limitation of (by the Xad engine) of additional parameter (not violating any known V1 situation) is to specify non-odd number additional parameter.For example, it is illegal being write as following:
(the Managed Avalon type of TargetType definition bottom, i.e. definition is used for the Avalon type of " Dock " additional param.)
The term additional parameter is derived from parameter by father's (but not entity itself) " providing " of entity or the fact of " adding ".
In addition, the DockPanel.Dock syntax is used for the character of parameter is labeled as an additional parameter.First aspect, the DockPanel definition provides the entity of this parameter.The while second aspect, Dock is defined in the title of the additional parameter that defines in the label definition of DockPanel.
2.4.7 inline data
In example up to now, specified simple static string by attribute, or depended on the data introducing XAD that data source will be more complicated.
Inline Data (inline data) entity is that the type that can be used for simple and complicated data are directly embedded among the XAD is the System entity of " sys:Data ".
Replace being write as following XAD:
Data from Data.xml directly might be embedded XAD:
Also might specify simple textual value (although the attribute syntax can be much simple and clear) with Inline Data entity.For some rim condition such as the character string that starts with " " or ". ", Inline Data entity is the unique method of directly specifying string in XAD.
The gained view shows:
$500
1) (says according to TonyW) and require to probe into the thinking of easily avoiding simple characters ' ' and '. '.In ' $ ' situation, seem to use ' $ $ '.It seems without any the method that is easy to avoid '. '.
2.5 by the binding parametrization
2.5.1 the name of label
This only hints that user-defined parameter can not be named as Name.It is illegal being write as following:
We not yet discuss the selector switch label, but this statement hints that all entities and packet label can be named now.This name is for the purpose that allows binding (having another name called entity shares) purely.For example:
We not yet introduce the concept of scope, but for ease of discussing, some parameter are considered as introducing a new range just enough.This statement represents, if do not have such " scope introducings " parameter in the main body of label definition, then name is necessary unique in the main body of label definition.
If in label definition, a plurality of scopes are arranged, then loosen the uniqueness of name restriction.Name only must be unique in given range.This should become more clear when range parameter is discussed.
2.5.2 be tied to entity
To a common data source, consider two views.Aspect XAD, this will be referred to 3 entities: 2 UI element entities and a data source entity of sharing.
In discussion up to now, at entity and they man-to-man mapping is always arranged between the parameterized entity with it.Yet the shared of entity is understandable average case.XAD has necessity structure of this situation of realization:
This will be illegal below expression:
The type of Beep Command entity is " sys:EventHandler ", but the type of Text parameter is " sys:Data ".
In the above example with table (Table) and tree (Tree), MyTable.xml has following form:
Tree can consume any tree, but Table requires the data (requiring the situation of data namely) of table shape.
Comprise following content what will occur if consider now that Table.xml changes into:
This Table will finish to be tied to non-table data (<SearchResult〉label).
In order to solve this mismatch, Table must be written as again to the binding of its Table parameter:
This binding is interpreted as " the Table Wire Parameters of Table is set interior myd:TableData element to the Xml that the entity by SharedDataSource by name returns ".
Be important to note that: $ SharedDataSource is tied to the root of Xml file, i.e. $ SharedDataSource another name<SearchResults... 〉.Therefore, $ SharedDataSource/myd:TableData in position is similar to and specifies myd:SearchResults/myd:TableData.
Being also noted that the use of name space prefix on this position---this is very important.
Because the Xml file has been specified the default names space of xmlns=" MyData ", so name space identical when attempting visit data must be used in the binding position in the Xad.In most of situations, the Xad application program is used as the default names space with Xad Framework name space.
Therefore, if binding is designated as:
And the Framework name space is the default names space in the Xad application program, and then this binding will be interpreted as:
Obviously, this will not provide the required data from the Xml file.Therefore, statement xmlns:myd=" MyData " name space is very important.So do not do usually is the cause of many destructive application program bug.
The entity that in fact can be tied in the main body of given label definition is limited by the concept of scope.This will more in depth touch upon when introducing the concept of range parameter following.
Effective relative position
Use in following Xml file (RelLocData.xml) the relative position example below:
The specify text element
Generation value: Stephen Danton
Some details of knowing
A critical aspects of noting is how relative position is mapped to the bottom data source.Note $ RelLocData
Generally be not mapped to the Xml documentOn the contrary, it is mapped to the root of the document:<TableData... 〉.
Another kind of thinking is that $ SomeBinding is as the another name of the Xml root of its institute's binding data.Can be write as for this reason ...
... because it is with to be write as myd:TableData/myd:Employees identical in fact ...
Some other sides of knowing are when to use binding.When data source did not have root, $ SomeBinding was directly bound to the text element of data and it is shown as its value, for example:
In the situation of specifying Text=" $ UnrootedData ", can see $ UnrootedData map directly to character string " Where is my root? "
Should be understood but easily the explicit final situation that accesses be to only have the data source of root (root only), for example:
In this case, $ RootOnlyData is mapped to label<Root〉also turn back to acquiescently the first text element under this label, namely go here and there " I Root therefore I am ".
The value of specified attribute
Generation value: 1.
Specify specific child
Generation value: Andy Wassyng (being the second son of Employees).
2.5.3 be tied to packet label
Except being tied to the entity tag, might be tied to packet label.For example:
Merge Tree Transform (merging the tree conversion) entity has the type of getting that is called " Trees " and is the parameter of a group object of " sys:Data ".By being tied to Resources (resource) packet label, Merge TreeTransform quilt " binding " arrives this group object under the Resources packet label.
2.5.4 be tied to the formal parameter of label definition
Even this theme is to discuss in the context of binding, its in fact not only relevant parameters binding.How it can easily create the label with abstract progressive rank (the spitting image of the function in the conventional language) with XAD if showing.
Consider following XAD fragment:
Comparatively actual is that supposition is wanted this XAD fragment is become the abstract of " TableWithCaption " by name.The spitting image of using function, this abstract user can want to make certain behavior Reparameterization.This can realize by the novel entities label that creates " TableWithCaption " by name.This label will be got 2 parameters: " Caption " and " TableFile ".XAD author can realize it by pure declarative definition:
The attention formal parameter is used with the duplicate mode of entity of quoting in the label definition main body and is quoted.
This is equivalent to and does not allow formal parameter to cover by local variable.It is illegal being write as following:
The abstract average case of establishment such as TableWithCaption will provide the default value of partial parameters.Label definition is for the such default value of appointment.In this case, the Caption parameter is designated as and can chooses wantonly, and is defaulted as string " Results ".
The instantiation of " TableWithCaption " will no longer need Caption (title):
If the silent string that admits a fault, then the statement of this acquiescence will comprise inline entity tag.For example:
2.5.5 allow editor with binding
Setting<sys:InLineData〉on Writable (can write) attribute so that Inline Data (embedded data) entity can write.
Following example illustrates can write Inline Data entity as the common use of " scratchpad (scratchpad) " in the XAD.
When at first showing Text, shown text is the initial value of Inline Data entity:
Bye
" MouseLeftButtonDown " is that type is the parameter of " sys:EventHandler ".The action corresponding with " MouseLeftButtonDown " parameter (by Param=" MouseLeftButtonDown " expression) runs at the Text entity calls when left mouse button is pressed event.
In this case, SetTextValueAction will be called, and will change in the Inline Data entity<Greeting〉textual value of element.This be because SetTextValueAction via Data (by Data=" $ Scratch Pad " expression) Wire Parameters to Inline Data entity.In a word, the received left mouse button of Text is pressed event and will be caused Text to show:
Ciao
Similarly, right mouse button is pressed event and will be caused Text to show:
Au?Revoir
Action is a kind of common methods that realizes the editability among the XAD with the binding that can write data.
Consider to relate to a kind of slightly different situation of in form, inserting newline:
Then the initial form that shows seems and will be similar to:
Achtung?Baby U2 19.99
Firestarter Prodigy 21.99
When form received right mouse button and presses event, AppendSiblingTreeAction will be called and will the value of its Tree attribute appointment be added on the node that is provided by its Sibling (brother) param.After this this tree will be similar to:
2.6 main label
Can see in the Hello of above standard World example, the entrance of Xad application program is similar to the principal function in C or the C# application program.When Xad design time shell, i.e. in Xad.exe when operation,, it searches the definition of " Main " label, i.e. the label of Name=" sys:Main " and used as the entrance that is application program.
Continuation about with the similarity of generic command language, sys:Main label definition available command row value is come parametrization.In addition, it represents automatic lifting for three predefine values of value after executive utility.
2.6.1 automatic filling parameter
The sys:Main parameter tags is kept 3 names, and they are XadBaseDirectory, InitialWorkingDirectory and MetaData.They each showed in an identical manner and bound.In addition, they all are read-only.Below will present an example using the XadBaseDirectory parameter.
XadBaseDirectory usually is used as the value of its BaseUri parameter explicitly with XmlFileDataSource, consider following Xad...
... $ XadBaseDirectory will be searched in the position of the file that passes to Xad.exe (being the design time shell of Xad application program) as the file that the value representation of BaseUri is associated with DataSource.So, if foo.xad is application program and it be positioned at C: xaf demos personal, then XadBaseDirectory will equal C: xaf demos personal, and will in this directory path, be searched for by the file of File definition.
Automatic filling value with 3 retention parameters of giving a definition:
● XadBaseDirectory-represents the Xad base directory of this application program, namely start the catalogue of this application program but not start the string of the position of Xad.exe
● InitialWorking Directory-represents the initialization catalogue of this application program, namely start the catalogue of this application program but not start the string of the position of Xad.exe
● current all that are associated with this application program of MetaData-are written into the tree of the merging metadata of assembly.Following Xad application program illustrates the use of all three parameters ...
2.6.2 command line parameter
Except the sys:Main parameter of the automatic filling that keeps, application program can be specified any amount of parameter with other names such as parameter such as sys:Main.These parameters can be by parametrization on order line, and can be used for the application deployment of all modes.Following Xad provides the sys:Main parameter of appointment, then provides an example of this order line of its value ...
... order line ...
xad?CommandLine.xad/TextData=Testing
... more generally ...
Xad<application file〉[/<parameter name 1 〉=<value 1〉[/<parameter name 2 〉=<value 2〉[...]]] [Switches]
... obtain following application program ...
(value that is delivered to command line parameter needs not to be plain text, and it can be filename, picture position etc.)
2.7 the piece of ignoring
Recalling Xad is a kind of language based on Xml.More specifically, any Xad code
NecessaryEffective Xml.This has produced interesting restriction when attempting with " note goes out and code " method exploitation Xad application program.For the purpose of clear, Xml does not support the nested of note, and for example following Xml is illegal:
Therefore, different from imperative languages such as c++ or c#, in the Xad of any specific syntax of not supporting this operation, be impossible to the note of note, this feature become sys:IgnoredBlock by name label form and be defined as follows.
IgnoredBlock (piece of ignoring) label can be positioned at<sys:Xad〉arbitrary place under the scope, as long as remaining Xad is effective.Below the consideration ...
... the Xad comment tag can not be surrounded any in these elements, because they all are essential for an effective Xad application program.
Occur the first time of IgnoredBlock label so that it is ignored by the Xad verifier with its child, consider following effectively Xad...
... add following IgnoredBlock label ....
... make it become invalid Xml and invalid Xad in this case.Therefore, the Xad verifier will be reported the mistake of invalid Xml, because Xad must be effective Xml before can carrying out further inspection.
As long as the validity of nested maintenance Xml just allows nested<sys:IgnoredBlock〉...
Consider following demonstrations<sys:IgnoredBlock〉Xad of the Xml note of outside
... be regarded as a large Xml note, namely IgnoredBlock does not have specific function, and it only is a character string in the Xml note at this.
An Xml note<sys:IgnoredBlock is surrounded in consideration〉outside Xml note ...
This is illegal.As mentioned above, Xad must be effective Xml always.Recall: can not surround the Xml note with note according to definition.
,<sys:IgnoredBlock different from the Xml note〉can not be used for avoiding invalid Xml...
... above Xad will return the inspection mistake of an invalid Xml:<FP 〉,<A〉and<B〉there is not an end-tag.Yet, be fine if add the Xml note ...
The IgnoredBlock label can not be used for note and go out the inside of sys:InLineData, considers following Xad...
... above code is interpreted as " inline data ",<EFG〉</EFG be not left in the basket, in fact<sys:IgnoredBlock become<EFG father.Therefore, the inline data data definition that in fact will be easier to see is ...
2.8 the parameter of spreading out of
2.9 white space
All data that enter the Xad application program all are regarded as " tale quale "---and no matter specify or defined statically by Xad author by data binding.Therefore, Xad will not show any UI assembly dedicated controls be used to controlling white space.This expression, different from Xaml, do not show that at the UI Element-Level xml:space=" Preserve|Default "-this is the unjustified zone of Xad and Xaml.
Select not support that in each UI element, data source, conversion etc. " keeping white space " parameter will allow us that Office class application program is taken up---the white space management that is this type is unpractiaca to Office class application program.On the contrary, we show WhitespaceTransform (white space conversion) (temporary name-MM3 feature), with allow Xad author's definition as how more the mode of the overall situation/data-driven process white space.
Consider following situation ...
All white spaces are considered as tale quale (as is).The meaning is if having following Xad...
... then be revealed as:
“Steve?”
Similarly, for ...
... it is revealed as:
“Steve”
Similarly, for ...
... it is revealed as:
“Steve?”
Equally ...
<Text?Text=“$foo”/>
$ foo=" Steve " wherein
(all of the value of $ foo are derived repeat.)
2.10 structure
The structure that lacks in the XAD is not got rid of any function of application.Yet, really simplify several workflow for large XAD application structure.
Consider to have in an action (preservation) of top layer definition and the application program of three states (recently document, user preference and enterprise preference).If this application program has several panes (be modeled as type and be the derivation label of " fwk:UIElement "), then problem is:
1. each parameter must be passed to each pane (data parameters can be used to reduce the quantity of data parameters via the gathering of Xquery, but can not help non-data parameters) by explicitly
2. adding an additional act (for example print) requires to add a new argument to each pane and (notes, can avoid the change of the label definition of each pane if pane is designed to share parameter group; Yet all pane examples still need be updated)
3. not (class that by its attribute is other class does not realize with typical OO with the mechanism of parameter grouping according to nested classification; Realize with XAF via attachment unit interface)
This situation by following illustration further to illustrate:
For ease of explanation, " single layer structure " (to solve the first two problem) at first will be discussed, then be generalized to " nested structure " (to solve the 3rd problem).Collective's feature that a conduct " structure " is in fact only arranged.
2.10.1 single layer structure
Following XAD will be write becomes the signature of specifying this structure:
Use the composition of sample of " app:ActionsAndDataSignature " signature to be:
Structure can be used in the label definition, and an one example is as follows:
An example of pane will be:
In main body, below binding will be that all parameters of " sys:EventHandler " are effective to type:
●“$ActionAndData.PrintAction”
●“$ActionAndData.SaveAction”
In main body, below binding will be that all parameters of " sys:Data " are effective to type:
●“$ActionAndData.RecentDocuments”
●“$ActionAndData.UserPreferences”
●“$ActionAndData.EnterprisePreferences”
Note, if as an example, user preference is by the data tree modeling of following form:
Then might be tied to automatic preservation set of frequency via " $ ActionsAndData.UserPreferences/AutoSaveFrequency ".
In main body, below binding is to all parameters of signature " app:ActionsAndDataSignature " (normally require the action of access application and hobby other derive the parameter of label) effectively:
●“$ActionAndData”
2.10.2 nested structure
Same situation can use nested structure (only being the popularization of single layer structure) to solve:
In main body, below binding will be that all parameters of " sys:EventHandler " are effective to type:
●“$ActionAndData.Actions.Print”
●“$ActionAndData.Actions.Save”
In main body, below binding will be that all parameters of " sys:Data " are effective to type:
●“$ActionAndData.RecentDocuments”
●“$ActionAndData.Preferences.User”
●“$ActionAndData.Preferences.Enterprise”
In main body, below binding is to all parameters of signature " app:ActionsAndDataSignature " (normally require the action of access application and preference other derive the parameter of label) effectively:
●“$ActionAndData”
In main body, below binding is to all parameters of signature " app:ActionsSignature " (normally only requiring other of action of access application to derive the parameter of label) effectively:
●“$ActionAndData.Actions”
In main body, below binding is to all parameters of signature " app:PreferencesSignature " (normally only requiring other of hobby of access application to derive the parameter of label) effectively:
●“$ActionAndData.Preferences”
2.11 pattern
Mainly being applied as of Avalon pattern:
● the property value of acquiescence element-specific
● the outward appearance of the Visual tree under the acquiescence element-specific
● acquiescence is to the input response (visual trigger) of element-specific
● specify the child of the repetition that how to show a control
These are divided into three classes:
1. be included in the each side of the pattern among the SDK1; By with the vague generalization of XAML model and make it can be applicable to XAD specific concept (for example deriving label) to come other interpolation value; This grammer is also nonessential to be identical, and only needs enough to approach to be defined as alignment area.For example, default property value.
2. promising on the vague generalization degree without substantive design and the each side of the pattern that comprises; These be valuable aspect and require to comprise in some way after-SDK1: for example Visual tree and visual trigger.
3. flimsy as current design and unlike for the each side of making the pattern that " office's level application " can bi-directional scaling; They solve by preferred XAD method.For example show and repeat child.In addition, can support the XAML method for compatibility, but these decisions will be made rear-SDK.
The field that this document is conceived to comprise in SDK1, i.e. default property value.
2.11.1 be used for the pattern of acquiescence purpose
The XAD engine with processing be designated as resource by name<sys:Style specific label.The specify default parameter value will be allowed, and the UI entity will be not limited to.Below be an example of acquiescence appointment:
This is illustrated in specifies before another the default style TextBox, and the XAD engine will carry out following action when creating TextBox:
● only when not specifying clear and definite Width (width), its Width is set as 100%
● only when not specifying clear and definite Height (highly), its Height is set as 100%
● only when not specifying clear and definite Background (background), its Background is set as solid red paintbrush
The stratified environments that " style information " will keep with the XAD engine is simply stored in order to link.Searching of pattern is hash search and the Walkthrough tree that need not to make progress.Can be different from Avalon at this, because utilized the artifactitious fact (delay disposal scope) when having the XAD operation.In addition, relate to the method that travels through Visual tree and will strictly limit acquiescence to the UI entity.
Closing a pattern can be by realizing the entity designated parameter of wanting design pattern.Below will forbid any previous pattern of TextBox:
Default value can be applied to derive label equally:
An example that is applied to the default value of non-UI entity is:
If AccessMode (access mode) parameter of XmlFileDataSource is not clearly specified in this expression, then it is set to ReadOnly.
Note, call parameter must be specified in XAD.It is impossible depending on and setting call parameter by pattern (for example Path of XmlFileDataSource (path) parameter).This restriction exists writes to allow.The existence that depends on pattern is fragile.
In addition, may be on type hierarchy specify default:
This is illustrated in specifies before another the default style UIElement, and the XAD engine will carry out following action when creating arbitrary UI connector:
If ●
1. support the Width parameter
2. and not clearly specify the Width parameter
3. and do not specify the special-purpose pattern (for example TextBox special use pattern) of the UI element of discussing,
Then Width is set to 100%
● the same for Height
● the same for Background
2) strict type matching? should perhaps check in addition " near IsAssignableForm " coupling? the type checking of pattern is more not stricter than conventional XAD.Particularly:
● because each UIElement can introduce its parameter, so will not check the parameter on " type pattern " (for example, above " UIElement " example).If type is for signature and therefore specified some parameter, those parameters will be through type checking (because do not allow to cover parameter, so this is possible) in XAD.
● the value of additional parameter will be examined in the pattern, be about to forbid DockPanel.Dock=" Garbage ".Yet, any additional parameter through statement might be written on the pattern.For example, even pattern can be applicable to not to be the child's of DockPanel TextBox, also may be write as follows:
3) will mark overall additional parameter.This all will require in any case for the bubbling event rear-SDK1.
Similar to XAML, will support implicit system level Wire Parameters by being called " Style " (pattern) on all entities to a special style.
Yet this pattern still need to be in scope.Note.The scope restriction really is not exclusively used in pattern, but the result of the Binding Model that draws the line.If necessary, can support and overall situation binding such as the particular type of Styles, but will check at present what degree the model that draws the line can use.
Even it does not have practical application, but note may being write as follows for for the purpose of the consistance:
Being tied to pattern is type-safety.Therefore will cause mistake below:
In a word, will support the model of Avalon to use pattern and interpolation value with acquiescence in several zones:
● default value is applied to all entities (only be not UI entity)
● default value is applied to derive label (but not only primitive label)
● acquiescence can be finished in the type layer of for example all UIElement (Avalon finally very likely supports this)
To not realize acquiescence on the type level for SDK1.
2.11.2Avalon the pattern of Visual tree
To finish by rear-SDK1 together with corresponding UI connector design this regional XAD design.
2.11.3 pattern and visual trigger
To finish by rear-SDK1 together with corresponding UI connector design this regional XAD design.
2.12 the parameter of setting range
Some parameters are introduced a new scope.The parameter of introducing new range has and is made as genuine " NewScope " attribute:
Can select the introducing scope for different cause parameter:
● introduce bound variable
● introduce delay and/or the repeated work of a unit
● above whole
To in this section, define the concept of variable and the delay/repeated work of setting range.
Be present on the range boundary with the entity of the parameter correlation of setting range connection.Rely on the advantage of their associated parameters, they introduce a range boundary.The nested scope of following illustration introduces entity and how packet label produces a range tree:
2.12.1 bound variable
The reason that parameter is introduced new range is to introduce one group of variable in scope.These variablees quite look like formal parameter, and its difference is that they are implicit declarations.The variable that is tied to setting range is realized to be tied to the identical method of formal parameter.
The variable of setting range is introduced parameter with scope of a declaration and is stated.For example, consider the label definition of Text:
The sys:ParamGroupRef definition is quoted the sys:ParamGroup label, and this seems as follows:
Note the definition of the sys:Param of MouseLeftButtonDown by name.It specifies the sys:ScopeVariable of NewScope and Position_X by name.
This expression: no matter when use the MouseLeftButtonDown parameter, it is all incited somebody to action:
1. introduce a new range
2. the sys:ScopeVariable that shows Position_X by name
The main points of the variable of setting range are to allow such as following situation:
The Xad that is used for this application program is as follows:
For all examples, will encourage you to move this Xad with the function of this application program of perception.
By using the bound variable be associated with MouseLeftButtonDown, can do at every turn mouse button by
When occuring, lower event upgrades the position of orange rectangle.Further check event code ...
... see two bound variable: Position_X of MouseLeftButtonDown parameter display and Position_Y.Use the parameter identical with all Xad bindings to finish to the binding of the value of those range parameters.
For example, below will be illegal ...
... because Position_X is showed by MouseLeftButtonDown.
2.12.2 duplicator pattern
Although the duplicator pattern is used by various entity types, its purposes is illustrated best by the Compound in the XAD standard card cage (compound) entity.The compound entity of data-driving is bound to data-collection, and for these data-each concentrated data item, it shows one son-element.
In many samples, used up to now the FlowPanel entity.This FlowPanel entity really has two kinds of patterns:
● (son-entity that will show is the Children parameter by Explicit designation) of regulation
● and (the duplicator pattern that use will define in this section) of data-driving
The definition of FlowPanel entity is not merely around Children parameter (as proposing in each example up to now).Its label definition seems more to be similar to following:
With specify in accordance with regulations son-entity opposite, might specify Data parameter and RepeatedChild parameter.This inserts the FlowPanel entity in " data-driving " pattern.
Note, FlowPanel label definition use<sys:Choice〉label, any realization of these these labels of labeling requirement, with use Children parameter (thereby definition regulation layout) or Data and RepeatedChild<sys:ParamGroup between select.
The RepeatedChild parameter is for each instantiation entity repeatedly among the Data.
The bound variable that is had a DataContext by name by the scope of RepeatedChild parameter introducing.This variable is set to the item corresponding with the sub-view of wanting instantiation.
Following fragment illustrates with the use of data-type of drive to the FlowPanel entity:
Suppose that List.xml comprises following Xml:
For each list items, the FlowPanel entity all will create a Text entity.For first Text entity, the value of DataContext bound variable will be:
$ DataContext/@Name binding will produce Name (name) attribute.When Text was bound to an attribute, it was shown as the property value of " Chris Hackmann " in this case.
This is equally applicable to each tabulation-item.If viewport (view-port) is enough large, then the FlowPanel entity will show below at screen:
Each provisional capital is corresponding to an instantiation of Text entity.What change from an instantiation to another instantiation is the value of " DataContext " bound variable.This pattern is called as " duplicator pattern ".It is among the XAD on data set the basis of iteration.
Because specific shorthand notation '. ' (single-point or fullstop), DataContext/ Name binding can be rewritten as ./Name should '. ' be retained with unique for the DataContext bound variable.
2.12.3 the bound restriction that scope is relevant
Scope is introduced some bound restriction.Binding from outer scope to interior scope is under an embargo.Yet the binding from interior scope to outer scope as shown below is allowed to.
The label that is tied in the interior scope is under an embargo.
2.12.4 nested duplicator pattern
In a joint of relevant " duplicator pattern ", illustrated how to realize simple iteration at data set.In this section, will consider a kind of more complicated situation.
Begin to consider following simple data collection:
Consider the following view of this simple data collection:
Customer Description Price
Luis?Figo Toaster 49.99
Luis?Figo VCR 199.99
This view can easily be realized with Table (form) entity, but will be limited to FlowPanel and Text entity for the purpose of illustrating:
For the people who is familiar with imperative language, only the iteration aspect can be by generally modeling is as follows:
Slightly more complex data set below considering now:
Consider this following view of complex data collection:
Customer Description Price
Luis?Figo Toaster 49.99
Luis?Figo VCR 199.99
Lilian?Thuram DVD?Player 279.79
Lilian?Thuram Receiver 549.99
Lilian?Thuram Sub-woofer 350.00
Unique real difference in this situation is to have extra one-level iteration.
Different from iteration on single purchase order (Purchase Order), incite somebody to action at first iteration on one group of purchase order.For each purchase order, still will generally do identical thing.Main Differences is that customer (client) hurdle will be the function of " outside " iteration now.
Again, for the people who is familiar with commanding code, iterative model generally is:
Simply add the same procedure of the extra iteration of one-level with commanding code, XAD will make equally:
Except the extra iteration of this one-level, another interesting explanation is use<sys:BindingName=" OrderDataContext " in this example〉entity quotes a bound variable from outer scope.In fact, so a kind of mechanism only relatively rare quote in the following bound variable situation useful:
● outside in the scope, and
● have with existing scope or comprise the identical name of bound variable in the scope
2.13 parameter is inherited
When creating the definition of derivation label, the parameter of existing entity can become by the BaseTag attribute available.For example ...
Note, Text and FontFamily usually are not transferred out and are the Param value in the label definition.This is because these parameters are specified in fwk:Text label definition, and is automatically handed down as the result who specifies BaseName=" fwk:Text " and to be handed to the definition of SimpleText label.
In addition, the value of definition is automatically distributed to the definition of SimpleText label in the label definition of basic label.For example, if FontFamily is endowed the default value of Arial, then this value is handed down and is passed the definition of SimpleText label.
The examples comparative definition---parameter value is preferential.When definition one label, to statically value of providing of interior attribute is provided ...
If these are not specified in the label example, then they keep " standing state ", if but they have obtained appointment, and then example value is preferential.Below the consideration ...
... take SimpleText with font size green font as 25 as example.The statement of FontSize=" 50 " in FontSize value displacement (having precedence over) label definition in this label example.
Special parameter can be defined as " forbidding " or " can not cover "; Below the consideration ...
For example ...
... because definition with this parameter-definition be minimum value be 0 and maximal value also be 0, check mistake (not being to warn) so the FontFamlily in the definition label example will produce one.
Note, the FontFamlily parameter still can arrange in the label definition statically, and is as implied above.
Appointment is illegal with the unmatched BaseTag value of type of the superiors' label, for example ...
... the above fwk:Border value that is used for its BaseTag parameter of having specified, but Text (type is fwk:Text) is defined as its top-level tab.
2.13.1 restriction
Parameter only can be inherited by top-level tab, for example, if write out ...
... for example ...
... top-level tab is Border (border), so its whole parameters all by new BorderText label automatic Display, and belong to Border label in this label definition.
Share parameter and consumed by top-level tab, for example ...
... although Border and Text have the Margin parameter, Margin is set in above example only is provided with the margin of Border but not the margin of Text.
For the value on the Text label is set, they need to and be bound in the Text label via the displaying of Sys:Param grammer, have below illustrated this point ...
... and the example of label seems as follows:
At last, do not support multiple inheritance.For example, can not define the label definition, then with the BaseTag of this label definition as another label definition.
For example, below be illegal:
2.14 conditional parameter
Although XAD is declarative language, it still enough is rich in expressive force to allow the condition structure of entity.
Two kinds of condition makes are possible: SwitchEntity or SwitchEntities.Each of these modes all can be come parametrization by Case (situation) or Condition (condition) label (but not being both).Case can be regarded as certain equivalence of C#switch (switching), and Condition is similar to one group of if-else clause of C#.
The use of Case and Condition is mutual exclusion, namely Switch can not be in its main body mixed C ase and Condition.In addition, Case only can use when Switch specifies the value of its Data parameter, otherwise must use Condition.
SwitchEntity, SwitchEntities, Case and Condition are present in the system namespace.According to standard, they are with prefix sys: name space, i.e. sys:Case, sys:SwitchEntity etc.
Consider that following data set is as example ...
2.14.1Case
Case is in two options better simply one.They have single V parameter alue.The value of Value must become IString by evaluation.Check mistake when in the situation of specifying Switch without the value of Data, using Case to cause designing, consider following illegal Xad...
... following Xad illustrates the correct use of Case ...
2.14.2Condition
Condition provides senior control to Switch result to Xad author.Condition shows single parameter Test.The value of Test is situation template, represents that it can be any effective xQuery.Condition only can use during not to its Data parameter designated value at Switch.
Condition used with the Switch that specifies the Data value check mistake when causing designing, consider following illegal Xad...
... the correct use of following Xad explanation Condition ...
2.14.3SwitchEntity
The author uses SwitchEntity so that can return conduct conditionally to the result's of switching evaluation single item.
The following Xad... of each in the consideration permission set of displayable data
Resulting view seems and can look like:
Consider now to want also to show with green Arial font with the price of red Georgia font demonstration more than 500 situation of the price below 100.XAD looks like now ...
Resulting view will to following similar (" Toaster " is shown as green runic Arial, and " Receiver " is shown as red runic Georgia):
2.14.4SwitchEntities
SwitchEntities can be used to return a plurality of values.This can represent to mate a plurality of Case or Condition, or makes single Condition return a plurality of values.Except the parameter of being showed by SwitchEntity, SwitchEntities shows a MatchFirst parameter.MatchFirst is false acquiescently, the value of all coupling Case of expression SwitchEntities coupling (namely returning) or Condition.
Be set in the genuine situation at MatchFirst, SwitchEntities only returns at first the Case of coupling or the value of Condition.Consider that the following MatchFirst of appointment equals false Xad...
... depend on the value in the input text frame, this Xad will mate one or more Condition and suitably show UI.Yet if MatchFirst is set to very, only evaluation is that a genuine Condition will make its value return.
2.14.5 summary
In the context of setting range not, use ' Switch '
When (for example under Resources) used in the context of the not setting range of not acting on behalf of, sys:SwitchEntity must specify a value to its Type (type) parameter, below the consideration ...
.... must define the Type of sys:Data.Check mistake in the time of can't definition of T ype causes designing on being in for the SwitchEntity label in the context of setting range.
Nested ' Switch '
SwitchEntity/ies can be nested with following mode ...
.... this should be pronounced, " if AppState=' is Blork ', shown the Text element of value for AppState/Foo if then test it, noted whether having AppState/Foo=' Bar ' ".
The nested additional parameter of conflict
Consider following Xad...
... additional parameter (with yellow highlighted) conflict.Outermost parameter (appointment on the sys:SwitchEntities label) shows that the rreturn value of this switching should dock at the top of father DockPanel.On the contrary, mate inner Case label (highlighted with cyan) and return a Text element, it specifies this Text should dock at the bottom of father DockPanel.
The result of this conflict is as follows:
● check mistake during design, show that this Switch has defined an additional parameter, it cover on may rreturn value appointment additional parameter
● innermost definition " triumph " when operation.The meaning is if that inner Case coupling, then this Text will dock at the bottom of DockPanel
● last, for guarantee clear for the purpose of, coupling as above visible default scenario docks at generation the Text element at father DockPanel top, and is specified such as the additional parameter on the Switch.
2.14.6 selector switch and label definition
In some cases, require the set of selector switch or selector switch is abstracted into label definition, thereby this selector switch can be reused in regional.
Consider following Xad...
... produced following application program:
Yet following pattern is illegal ...
2.15 related
XAD allows the related of any entity and data.Consider the Xml statement of the following modeling that the work space of an application program is arranged:
Note, do not use " LayoutScheme " and " ActiveDocumentIndex " in the example herein---they only are the structure and the pattern similarity that usually uses in application program that makes this statement at there.
The MDI application program will be a such state transfer to the subsystems in this application program.The example of these subsystems will be:
● in independent mdi child window, show the actual MDI work space of the content of each opening document
● with the side hurdle of the thumbnail of all opening document
● with the menu such as orders such as " preserving all documents "
These " subsystems " all will require not only lists of documents to be operated separately, and Data Sources (data source) operation to being associated with these documents.Ideally, subsystems will be shared this same Data Sources (data source) example.In fact share for being essential such as situations such as relevant views.Should share and to realize by the entity class that is called association manager (Association Manager).
Association manager is the entity that creates and manage a plurality of entities associated with the data.For example, the association of each list items in tabulation association manager (List Association Manager) establishment and the managing listings:
This XAD represents following implication:
● this tabulation association manager is managed<OpenDocument〉tabulation association.
● each (be each<Document 〉) in the tabulation will create file data source (File DataSource) conduct " associated entity ".
● it is corresponding<Document that each File Data Sources will make its File (file) setting parameter〉Filename (filename).Data context (". ") is corresponding list items (namely<Document 〉) always.
● when list items (be each<Document 〉) was added in the tabulation or therefrom removes, corresponding associated entity (being File Data Sources) was added and removes.Note, the actual creation of entity is finished as required.
Client is via<sys:AssociatedEntity〉quote association:
This XAD represents following implication:
● for<OpenDocument〉in the tabulation each<Document, stop panel and all show a profile view.(profile view is the UI element that shows the supposition of its Tree (tree) parameter with the profile form.)
● the Tree parameter of each profile view is an associated entity.
● associated entity is the File Data Sources that is associated with list items (be each<Document 〉).Association manager can be modeled as dynamic dictionary:
<sys:AssociatedEntity〉can be regarded as acting on behalf of the entity of the value in the association manager; The value of acting on behalf of is by<sys:AssociatedEntity〉the Data driving parameter.
Note, although associated entity in this example is Data Sources (data source), the type of associated entity can be arbitrarily, for example Event Handler (button.onrelease).
2.16 label documentation
With the form of scanning, method in order to the XAF of XAD label documentation is the method for quoting documentation that imitation C# is used for managed API: quote the .xad code that note can be incorporated into the XAD label, and this note can be extracted and aftertreatment by instrument similar with the instrument of the MS inside generation that is used for managed API reference document in concept and design.
Three additional specifications contain XAD quotes documentation:
● XAD label: document content and aftertreatment situation
● XAD label: document markup and demonstration
● XAD label: document Core Generator
The content of these standards should easily be distinguished based on its title.
Following formal language standard chapters and sections comprise the discussion of quoting the documentation markup tags of control being quoted the structure of documentation.For the full details of all documentation respective labels, referring to aforesaid
Document markup and demonstration standard
3. formal language standard
This section provides and has been used for the more not form statement of many language construct of form ground introduction of last joint." language construct " means the label (http://schemas.microsoft.com/2005/xad/system) of surviving in the System name space.
As mentioned above, the XAD code is written as the good Xml of form.First labeling requirement of XAD file is<sys:Xad 〉.File common (but not necessarily) has the .xad extension name.Packing and deployment structure while for this language basis only exist
The 5th jointMiddle formal definition.
The local XSD standard of XAD language can
Http:// xafteam/xafenv/doc/Platform/Application%20Components/xad .xdsObtain.It mainly is because XSD does not have enough expressiveness to catch many structural constraints that this standard is considered to " part ".
3.1 boolean properties
All boolean properties on the XAD System label all are optional.It is false that default value is always.In fact this mean and need not to specify boolean properties, unless its value is necessary for very.In other words, lack attribute and always mean that its value is false, exists and should mean that then its value is true.For consistance and readable reason, suggestion framework expansion person follows this agreement when boolean's parameter of definition its oneself.
3.2 qualified name
XAD is a kind of language based on Xml, and uses in a large number the Xml qualified name.Qualified name belong to the specific names space with guarantee uniqueness and avoid conflict (referring to
Http:// www.w3.org/TR/REC-xml-names/To obtain more details).Use the XAD language construct of qualified name to be:
● type
● the label definition
● signature
Publicly-owned parameter group
For given XAD application program, each example in each structure bucket (bucket) listed above must have strides the unique qualified name of whole bucket.For example, two signatures that have two types of same name or have same name can not be arranged.Yet, can have identical name from the item of different buckets.For example, label can have identical name with signature, and perhaps parameter group can have identical name with type.
3.3 key word
3.3.1?<Xad>
3.3.2?<Doc>
Example:
3.3.3<Description>
Referring to preceding example right to understand<description the simple use of label.Referring to XAD Tags:Docmarkup and presentation spec right to obtain<description the more comprehensively processing of use of label.
3.3.4<Type>
3.3.5<TagDefinition>
3.3.6<Signature>
3.3.7<ParamGroup〉(<Xad〉under)
3.3.8<Const>
3.3.9<Param>
3.3.10<OutParam>
3.3.11<ParamGroup〉(<Choice〉under)
3.3.12<ParamGroupRef>
3.3.13<Choice>
3.3.14<ParamDefaultValue>
3.3.15<ConstDefaultValue>
3.3.16<Entity>
3.3.17<Function>
3.3.18<Body>
3.3.19<ScopeVariable>
3.3.20<AttachedParam>
3.4 built-in entity
3.4.1<InlineData>
3.4.2<Binding>
3.4.3<XPath>
3.4.4<Mapping>
3.4.5<DynamicEntity>
Note, when specifying Namespace, the value of Tag must be local name, that is, the value of Tag can not be " scal:DatePicker ", and on the contrary, it must be " DatePicker ".Consider following Xad:
Error situation
Mistake 1 checks the mistake that is associated with DyanmicEntity
Situation: when attempting to load transaction, a series of inspection mistake occurs, these check that mistake is placed into the state plate that is associated with this DynamicEntity.
3.4.6<AssociatedEntity>
Error situation
Mistake 1 invalid association
Situation: use the tabulation association manager, the author is imported the back end that is not resolved to this manager association into.
3.4.7<AssociatedDataEntities>
3.4.8<SwitchEntity>
3.4.9<SwitchEntities>
3.4.10<Case>
3.4.11<Condition>
3.5 entity makes up device
It is for creating entity and/or to the user-defined .NET class of its line (wiring) that entity makes up device.Entity makes up device and is used for realizing primitive XAD label.XAD language definition be used for entity is made up the requirement of device line because they are the interaction point between the self-defined expansion of XAD working time and this language.Depend on entity structure and line, have following four kinds of methods to realize defining the primitive label of novel entities:
In in 4 kinds of situations 3 kinds of attention, must designated entities make up the device class.XAD has defined and has been used for two interfaces that entity makes up device:
Depend on entity structure and line, entity makes up device can realize one of this interface or both:
N: structure line ICreateEntity IWireEntity
Simply whether 1
Whether 2 is complicated no
3 complexity are
Entity is made up the requirement of device:
● stateless.Do not allow entity to make up device and between Create and/or Wire method twice called, keep local state.XAD can create the object pool that entity makes up device for efficiency reasons working time.Therefore, the order that calls and the number that makes up the device method do not guaranteed.
● behavior during without broadcast.Entity makes up device can finish two things---create entity and to the entity line.Do not allow other anything.Do not allow entity to make up any other interface that device uses the entity of their establishments or line.
Following example shows the label definition of primitive label and the realization that corresponding entity makes up device:
It is an example of the simple version of same label herein.Because entity need not to access constant parameter and without any special constructor parameter, so entity makes up device and need not to realize entity structure, only realizes line:
3.6 action
Generally speaking, action is entity, and it realizes entity type " fwk:EventHandler ".
Order can realize as any other entity---by realizing entity class and label being defined line.
Yet action is identified as one of modal entity, and XAD supports to realize replacing their more plain mode.XAD allows action is embodied as function rather than entity.On the backstage, XAD working time with the XAD Parameter Mapping to C# parameter and call function.
The function of realizing as order must satisfy following requirement:
● be defined as the method for entity class.Entity class provides the access to the entity domains service.Can realize an above command functions at same entity class.Yet this only is that packing is convenient, and and does not mean that any mutual between the action.
● stateless.How when operation, to determine XAD working time the example of administration order entity.For example, may be the new example of each time command calls establishment entity class.Do not allow action once calling hold mode between another time.All information about application program that they need to be understood must be transmitted as parameter.
● without quoting and spread out of parameter.The action that realizes as function can not have output parameter.XAD does not generally support reference parameter, so command functions can not be used them.Action is by coming the application programs state to make a change to carrying out line as the data write of importing the parameter transmission into.
Command functions is got entity as parameter.Usually, parameter is data entity.XAD is convenient to access to data entity by the access that allows strong typing.Except using generic data entity type ICRange, the order author has the memory access of use strong typing as the option of parameter type.
Note, replacement is used filename and is spread out of or reference parameter, uses and upgrades memory access.
The memory access that the specific data entity is not supported is wrong.Except command functions, must write corresponding label definition.Parameter name in the label definition must mate the tag name in the command functions fully.XAD comes matching parameter according to name working time, and therefore having not, the matching parameter name is wrong.The parameter order is unimportant.
But allow optional parameter (Min=" 0 ").But the default value of optional parameter can be specified in the label definition.If there is not the specify default value, then XAD will transmit sky working time, and client code must be ready to process it.It is wrong that but definition does not have the value type optional parameter of default value.
Allow setup parameter (Max=" unbounded ").Setup parameter must be turned to ICollection by type in function.Can using generic in the future, come to specialize in this set with this type.
What interface should 4) self-defined detector realize?
5) the how conflict between processing parameter name and the additional parameter name?
6) do you wish to support the parameter that spreads out of on the D ynamic instantiation entity?
Will 7) use generic in some way to pass to the entity of Wire be strong typing? about the value of parameter how about?
4. common framework entity
5. deployment model
5.1XAD application program
The XAD application program is made of various relevant segments.XAD packing and deployment model have defined the rule that is used for for following purpose these segments being combined and being defined the relation between them:
● all parts of identification application (composition of application program)
● the integrality of verifying application programs
● run application explaining and compile in two kinds of patterns
● disposing application program
● versioned
XAD uses packing and the deployment model based on subassembly, it follow the Microsoft deployment strategy (see Fusion,
Http:// fusionTo obtain its details).Fusion processes such as problems such as versioned, side by side installation, " DLL hell ", management, strategies, so it is useful for taking full advantage of its deployment model with service.
Various application program segments are combined into larger bag, are called subassembly.Subassembly is combined to form application program:
Each XAD application program has one entrance-application program and processes from its label that begins.The requirement of application programs entrance is:
● label must define in the root subassembly.
● the local name of label must be Main.Name space must be http://schemas.microsoft.com/2005/xad/system
● if label is got parameter, and then they must be simple data type (string, Integer, Boolean etc.), so they can be passed from order line.
5.2XAD subassembly
The XAD subassembly is minimum deployment unit.It is fusion (fusion) subassembly with XAD semanteme.
The XAD subassembly is made of following two parts:
● component list (seeing 5.3)
● the composition file
Subassembly composition file (listing in the component list) comprises actual XAD code (label definition, entity type, signature etc.) and as any out of Memory of the part (data-selected scheme, metadata, resource etc.) of application program.In case XAD or scheme file are listed in component list as composition, its content becomes and can use the following:
● all the XAD files in the subassembly
● rely on all the XAD files in the XAD subassembly
Type, signature, parameter group and label definition can be defined as " inside ", and they are sightless in its subassembly outside in this case.
The XAD file is not quoted other XAD or scheme file.Dependence (using label from other file, type etc.) on the subassembly level but not file-level process.
Yet, but the other Languages supporting document that uses in the XAD application program is quoted.For example, XSD supports to comprise and derive pseudoinstruction (directive).The file that comprises or derive does not become the part of subassembly automatically.They must be listed as the composition file clearly.
What should 8) protection do about intellecture property (IP)? the subassembly of compiling may be answer.
All composition files must be arranged in the residing identical file folder of component list or sub-folder (supporting any dark nested rank of sub-folder).
The XAD subassembly there are following two kinds of forms:
● non-PE multifile subassembly.
PE represents " portable can be carried out ".This form is easily between development stage.The Single document that does not comprise whole subassembly.The composition file is used when they are created by XAD author and are kept on the dish.XAD finds them by the fetch unit inventory working time.Any change to the composition file is reflected on the subassembly when preserving file immediately.Do not need compile step to use subassembly in the XAD application program.
● the .NET subassembly
This is the compiling form of XAD subassembly, is easily to deployment.Compiling provides better performance.The XAD subassembly stores with binary format, and can sign with strong name, so it can be disposed in GAC (global group component high-speed cache) as other .NET subassembly.It is essential, so the XAD subassembly of compiling is processed and generate the reason of meaningful Watson dump for mistake, with allowing error correction is gone back to original XAD source.
5.3 subassembly component list
XAD subassembly component list is the Fusion component list, and can be consumed by Fusion.It has intactly described the XAD subassembly.Component list is the Xml file with " .manifest " extension name.Up-to-date Fusion component list scheme can
Http:// teamweb/manifest/Shared%20Documents/Latest%20Manifest%20 schema.htmOn find.
Component list can be come manual creation with text editor, or creates by developing instrument.When exploitation, component list has been played the part of the role of configuration file---and it has recorded all parts and the dependence thereof of subassembly.In when operation, component list has played the part of that XAD is used for finding out working time and the role of the catalogue of all parts of loading application programs.
XAD does not understand that whole Fusion component list scheme---it is identified its some part and ignores remainder working time.
The component list of XAD identification partly has:
● the subassembly identity
● describe
● to the dependence of other subassembly
● the composition listed files
Fusion component list scheme destination name word space is " urn:schemas-microsoft-com:asm.v2 ".This scheme is extendible---can add element and attribute from other name space.XAD only adds several attribute conducts
Http:// schemas.microsoft.com/2005/xad/assemblyThe expansion that defines in the name space.XAD need not unit widening parts inventory scheme usually.
Attribute below with reference to the Fusion component list Xml element of having described XAD identification and attribute and XAD interpolation.
5.3.1 component list label
Is 9) what the purposes of " culture " attribute? it is only for the combinations of satellites part in .NET.How to process the localization resource?
10) problem of the current purposes of type attribute:
-be archived as " be used for backwards compatibility " and can removing in the future
-there is not method to come globally retention " xad "
-type is only just meaningful when relying on the item appointment
Should change the extended attribute in dependentAssembly element definition oneself into?
Be 11) what the future of behavior mapped file?
5.3.2 exemplary components inventory
This exemplary components inventory has been described the subassembly with name " Demo " and version " 1.0.0.0 ".
" Demo " subassembly depends on following two other subassemblies:
● " Microsoft.XAF.XAD.Framework "-XAD subassembly (type=" xad ")
● " DemoEntityBuilders " .NET subassembly (not specified type)
" Demo " subassembly has following two composition files:
● the DemoTags.xad-XAD file finally can comprise label definition, signature, entity type and publicly-owned parameter group.
● DemoDataSchema.xsd-scheme file
5.4 subassembly dependence
By setting up the dependence to another subassembly, the XAD subassembly can use its non-inside:
● entity type
● signature
● the label definition
● parameter group
● scheme
Dependence to another XAD subassembly is by comprising that in component list its identity and specified attribute type=" xad " in the tabulation of dependence subassembly sets up.Need not specified file or routing information.The subassembly identity when operation resolve and will load correspondence subassembly (see "
Subassembly binding, loading and unloading").
The XAD subassembly also can be dependent on the .NET subassembly.To the dependence of .NET subassembly with the identical mode of the dependence of XAD subassembly is set up, have the different value except not specifying type attribute or this attribute.Must when in the following, quoting the .NET type by the XAD subassembly, set up the dependence of .NET subassembly at every turn:
● the entity type definition
● the entity reference in the definition of primitive label
● the entity in the definition of primitive label makes up device and quotes
● the order class reference in the definition of primitive label
● metadata
To be applied to the dependent rule of XAD subassembly herein:
● a subassembly can depend on a plurality of subassemblies (A can be dependent on B, C, D etc.)
● a plurality of subassemblies can depend on same subassembly (B, C, D etc. can be dependent on A)
● the subassembly dependence is that non-transitive (if A depends on B and B depends on C, then A does not rely on C.If necessary, A must quote C clearly.)
● do not support circular dependency (if A depends on B and B depends on C, then C can not depend on A)
5.5 subassembly binding, loading and unloading
Binding is the process that the subassembly identity is resolved to its physical location.
The subassembly identity does not comprise the positional information such as path and file.Fusion has defined the subassembly binding algorithm that .NET uses working time.XAD will use this binding algorithm as the service that is provided by Fusion for a long time.It realizes its subalgorithm (Childrenet) in short-term.
Require all non-strong name subassemblies (not having the PKI mark) under Application Folder, to exist.Application Folder is the file that comprises the component list of root/main subassembly.
Given subassembly identity, XAD uses following algorithm to find out subassembly working time:
1. if the subassembly type is not " XAD ", suppose that then it is the .NET subassembly and loading entrusted to the .NET framework.
2. to the XAD subassembly, check in the Application Folder to have the component list file of subassembly title and load it.
3. if do not find, then check the sub-folder that has the subassembly title in the Application Folder.If find, then check to have the component list file of subassembly title and load it.
4. if do not find and this is that debugging makes up, then to each the file repeating step 2 and 3 of appointment among the environmental variance XADPATH.Instrument when this only is exploitation.Path among the XADPATH separates with branch.
In case find, add carrier package and all working time by XAD and rely on.This process is recurrence---it is to relying on a repetition.Each content that relies on item can be used relying on subassembly.Be important to note that, do not make the content of subassembly available to all subassembly overall situations, only it is directly relied on item available.
Scheme is the exception of this rule.When loading had the subassembly of scheme composition file, loading scheme also added it to the global scheme set, thereby so that they can use all subassemblies.Yet this is to the restriction of current realization and should not be considered to requirement.Its most probable is changing in the future.
Have two kinds of methods to add carrier package:
By the static dependencies in another subassembly component list.
In program design.
Pass through LoadAssemblyCommand.
By rudimentary publicly-owned API.
From root subassembly (set of applications component) begin and arrive that it relies on, dependence item that it relies on etc., form any dark figure of static dependencies subassembly.XAD loads all these subassemblies working time when application program launching.The developer also can load the subassembly that is not designated as the static dependencies item.The feature of the subassembly that loads in the programming is that plug-in unit (is seen as the main situation of target
Plug-in modelTo obtain more details) support.
Set of applications component (root) and the upper subassembly that loads of all programmings have formed one group of top layer subassembly.Only top layer subassembly application programs metadata has contribution.The top layer subassembly that only has the exception of root subassembly can be in the programming unloading.If subassembly does not load as the static dependencies item, even then it also loads in programming as the top layer subassembly after a while, it can not be unloaded.Unloading this subassembly only causes it is removed from the top layer subassembly but does not remove from the subassembly of static loading.
5.6 packing situation
5.6.1 monofile application program
" Hello world " is an example of simple monofile application program.The monofile application program has single XAD file, and it comprises all required information of this application program of operation.This document must comprise label definition---the application program entry point of main label at least.Need not to create subassembly or subassembly component list.
Requirement to the monofile application program is:
● only depend on standard card cage.The standard card cage acquiescence is available, and need not to be appointed as in the subassembly component list dependence item.If application program is only used label, type and signature from standard card cage, then it need not to specify any dependence (not having the dependence part in the component list) in its component list.
● in Single document, have all labels.If a file is only arranged, then application program does not require the composition file part of component list file.In case have more than a file, then regardless of its type, application program all requires component list to describe the composition file.
If satisfy these requirements, then application program does not require the subassembly component list fully, because all piths all are empty.It is the monofile application program.
5.6.2 derive the storehouse of label
XAD allows XAD author to expand language by defining its oneself label.The simplest mode is to define the derivation label because they be realized by XAD and do not need rudimentary programming technique.XAD author proposes the most at last one group of reusable customized label and a plurality of subassemblies are striden in hope and application program is shared them.This can finish by packing label in the subassembly that separates, and should then can be quoted by other subassembly by subassembly separately.
In following example, two reusable derivation labels are arranged, they define in the MyTags.xad file and pack in the MyLibrary subassembly.The MyLibrary subassembly is quoted by the MyApplication subassembly, and the label that is provided by this storehouse is provided the latter.
Below be how it works:
● two label-TextWithLabel of MyTags.xad document definition and Hyperlink.
● the MyTags.xad file is listed in the MyLibrary component list as the composition file.This so that all labels in the file can use MyLibrary subassembly client.
● the MyApplication subassembly is quoted the MyLibrary subassembly, and therefore can access all labels that define among the MyLibrary.
● the MyApplication file uses the Hyperlink label that defines in the MyLibrary subassembly.
5.6.3 the storehouse of primitive label
XAD can be by defining self-defined primitive or deriving label and expand.Be easier to definition although derive label, because they realize with XAD, the primitive label can provide abundanter function, because they are with realizing such as the rudimentary programming language of VB and C#.These language provide the fully access to OS and machine resources.Assembly, instrument and platform developer definable primitive label, this label can be reused in a plurality of XAD application programs by XAD author.Packing primitive label is almost identical with packing derivation label (seeing above example).Following two main differences are arranged:
● label definition comprises entity is made up the device class but not the quoting of XAD main body
● the component list that comprises the subassembly of primitive label must be specified the additional dependence that makes up the .NET subassembly of device to comprising entity
It is the .NET assembly that entity makes up device, and this assembly knows how to create corresponding to the entity of primitive label and to its line (making up the more details of device referring to language concept with acquisition about entity).
Following example is embodied as the primitive label with Hyperlink:
Client code is identical as the code of deriving label with use Hyperlink.The realization details that the groups of clients component neither represents to the label that comes from other subassembly does not represent to its dependence item yet
6. plug-in model
6.1 what is plug-in unit?
Plug-in unit (being also referred to as interpolation annex or insert) is self-contained software package, and it has been expanded the essential characteristic collection of given software application and need not upgrade applications.But plug-in unit allows incrementally to add them and need not to wait for and experience expensive upgrading circulation in new feature or third party's expansion time spent that becomes.
For making plug-in architecture work that four important requirements be arranged:
● must definition and announcement extensibility agreement
● the application program of expansion must correctly realize the extensibility agreement
● plug-in unit must correctly be realized the extensibility agreement
● application program must be supported discovery and the loading of plug-in unit
6.2XAD plug-in model
The XAD plug-in model is based on following key:
● the dynamic load of subassembly
● the extensibility agreement of metadata driven
● the transaction instantiation
6.2.1 the dynamic load of subassembly
Plug-in unit is packed in subassembly.This is not wonderful, because all parts of XAD application program are all packed in subassembly.Usually subassembly by the static dependencies item of appointment in the subassembly component list load (referring to
The subassembly dependence).
XAD loads all static dependencies items working time automatically.In this case, subassembly is not listed in any component list as the static dependencies item.On the contrary, application program can be used the order<loadAssembly of system definition 〉, add carrier package by specifying its component list path.The path only is data fragments, and can obtain from user's input, Application Status, configuration file etc.In case loaded subassembly, update metadata and its entity become and can be used for D ynamic instantiation.
6.2.2 the extensibility agreement of metadata driven
Can expand the XAD application program and in independent subassembly, define its extensibility agreement, so it can be announced and quote with the third party who writes expansion by application program.The extensibility agreement has following two parts:
● metadata proposal: term " metadata " generally refers to " about the data of data ".In the context of the present specification, metadata is as the description to feature that is realized by plug-in unit.Metadata can comprise tag name, the parameter that will transmit, be used for the readable text of people of UI etc.Extensible application has defined metadata proposal (desired from plug-in unit).Plug-in unit provides content.
● the label signature: plug-in unit is realized its feature by definition XAD label.Application program uses these labels to visit the plug-in unit feature.Application program definition label signature (plug-in unit should cause what entity type and them to get what parameter), and plug-in unit provides label definition (tag name and actual the realization).Signature can be compared with interface, and the label definition can be compared with Interface realization.
XAD supports can be by the label of system definition
<Matadata 〉The global metadata tree that visits.Metadata tree be from the union of all metadata composition files of the subassembly of all dynamic load (referring to
File typeTo obtain the details about composition).When operation, automatic update metadata is set when load or unload has the subassembly of metadata composition file at every turn.Send suitable change notice, so application program is dynamically upgraded himself.Use metadata tree, application program can find to load what plug-in unit and use the feature that they provide.
6.2.3 transaction instantiation
Usually, XAD author directly writes the XAD label with the XAD code.By using the XAD label, the author has stated to create what entity working time by XAD statically.
Plug-in unit has defined the label of the feature that is used for their realizations of access.Because plug-in unit is disabled when writing application program, so XAD author's there is no telling also uses the label by the plug-in unit definition.The author only knows and defines statically label signature.Physical tags name and final parameter value are provided by metadata by plug-in unit.Application program knows fully what metadata proposal is, because it is the part of the extensibility agreement of application program definition.It reads metadata and according to tag name instantiation entity dynamically.XAD supports to be used for being undertaken by tag name the label of the system definition of transaction instantiation:
<DynamicEntity 〉The entity that only has agency's type can be by dynamic instantiation.Entity only could be by dynamically instantiation when they define in the following:
● the subassembly of dynamic load
● the static dependencies subassembly of subassembly, use the DynamicEntity label
6.3 plug-in unit situation
Following situation has been described can be by plug-in extension to support the application of file of new file type.The thinking of this application program is the file that it could open and show any type, as long as it has the plug-in unit of supporting this document type.This example has 3 parts:
● the FileExtensionProtocol subassembly
The Extended Protocol of defined file application program.This Extended Protocol is made of the metadata proposal and the signature that are used for each file label.It defines in independent subassembly, so application program and various plug-in unit all can be quoted it.
● the File subassembly
The subassembly that is used for the application of file code.
● the SmartFilesAddIn subassembly.
The plug-in unit subassembly that provides of the Smarts.com of company by imagination.
6.3.1FileExtensionProtocol subassembly
6.3.2File subassembly
6.3.3SmartFilesAddIn subassembly
7. appendix A: code is write agreement
It below is the tabulation that the XAD code of suggestion is write agreement.Standard x AD framework is followed all these agreements.The third party can select to adopt in these agreements partly or entirely.
These agreements are forced by XADCop.XADCop is the special-purpose detector of XAD that is similar in essence the FxCop in the Net framework.
12) $ waits to finish: in case available, to the link of XADCop document
7.1 be used for " sys " prefix of System name space
13) $ waits to finish
7.2 the Pascal external packing of name
14) $ waits to finish
7.3 the signature name must finish with " Signature "
15) $ waits to finish
7.4 the name of " Set " parameter must finish with " s "
16) $ waits to finish
7.5 the name of " Singular " entity tag must not finish with " s "
17) $ waits to finish
7.6 the name of selector switch label must finish with " Selector "
18) $ waits to finish
7.7Param (if appointment) must be first attribute of entity
19) $ waits to finish
7.8Name (if appointment) must be Param (if appointment) first attribute afterwards of entity
20) $ waits to finish
?[1621]