Abstract:
A method for generating a model diagram includes registering a scoped domain editor extender with a domain model element, retrieving a domain model and sending the domain model to the registered scoped domain editor extender, generating a modeling language model and mapping the modeling language model to the domain model, retrieving a domain model element from the domain model, generating a modeling language model element and associating the modeling language model element with the domain model, generating a graphical diagram including a shape corresponding to the modeling language model element, generating a user input item and associate the user input item with the modeling language model element, and displaying the shape and the user input item to a user.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application claims priority to Canadian Patent Application No. 2706747 filed 29 Jun. 2010, and all the benefits accruing therefrom under 35 U.S.C. §119, the contents of which in its entirety are herein incorporated by reference. 
     BACKGROUND 
     The present invention relates to computer code editors, and more specifically, to visual code editors and domain language visual scoped editors. 
     Visual code editors for programming codes such as Java may include visualizing features that present Java methods as a Unified Modeling Language (UML) diagram that visually represents elements of the code. The diagram represents a domain language for example, Java, and typically includes code blocks that represent programming elements such as loops and if/else statements; however the code blocks do not include details of the code represented by the blocks. It is useful for a user to have the ability to easily review specific code details represented by the blocks when analyzing a diagram. 
     BRIEF SUMMARY 
     According to one embodiment of the present invention, a method for generating a model diagram includes registering a scoped domain editor extender with a domain model element, retrieving a domain model and sending the domain model to the registered scoped domain editor extender, generating a modeling language model and mapping the modeling language model to the domain model, retrieving a domain model element from the domain model, generating a modeling language model element and associating the modeling language model element with the domain model, generating a graphical diagram including a shape corresponding to the modeling language model element, generating a user input item and associate the user input item with the modeling language model element, and displaying the shape and the user input item to a user. 
     According to another one embodiment of the present invention a method for generating a fly-out editor window includes receiving an input from a user selecting an input item, identifying and retrieving a modeling language model element associated with the selected input item, retrieving a domain model element associated with the modeling language model element from a domain model, determining whether a scoped editor is registered for the domain model element, sending the domain model and the domain model element to an extender responsive to determining that the scoped editor is registered for the domain model element, generating a scoped code editor and displaying text associated with the domain model element in a fly-out editor window to a user. 
     According to yet another one embodiment of the present invention, a system for generating a diagram including a processor operative to register a scoped domain editor extender with a domain model element, retrieve a domain model and sending the domain model to the registered scoped domain editor extender, generate a modeling language model and mapping the modeling language model to the domain model, retrieve a domain model element from the domain model, generate a modeling language model element and associating the modeling language model element with the domain model, generate a graphical diagram including a shape corresponding to the modeling language model element, generate a user input item and associate the user input item with the modeling language model element, and send the shape and the user input item to a display. 
     Additional features and advantages are realized through the techniques of the present invention. Other embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed invention. For a better understanding of the invention with the advantages and the features, refer to the description and to the drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS 
       The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The forgoing and other features, and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which: 
         FIG. 1  illustrates an exemplary embodiment of a system. 
         FIG. 2  illustrates a high level block diagram of an exemplary embodiment of a scheme for displaying code elements. 
         FIG. 3  illustrates an exemplary embodiment of a portion of a diagram. 
         FIGS. 4A and 4B  illustrate exemplary block diagram detailing the generation of the model diagram of  FIG. 3 . 
         FIGS. 5A and 5B  illustrate exemplary block diagram detailing the generation and display of fly-out editor windows of  FIG. 3 . 
     
    
    
     DETAILED DESCRIPTION 
       FIG. 1  illustrates an exemplary embodiment of a system  100 . The system  100  includes a processor  102 , a display device (display)  104 , input devices  106 , and a memory  108 . The system  100  is operative to perform the exemplary methods described below. 
       FIG. 2  illustrates a high level block diagram of an exemplary embodiment of a scheme for displaying code elements. The scheme may be implemented, by for example, executable computer code stored in the memory  108  and processed in the processor  102  (of  FIG. 1 ). The illustrated embodiment includes a plurality of application programming interfaces (API&#39;s) that extract domain language constructs, for example, a Java API  202  extracts Java language constructs, a C++ API  204  extracts C++ language constructs, and a XML Scheme Definition (XSD) API  206  extracts XSD language constructs. The illustrated embodiment may include any number or type of APIs. A domain to UML mapping system  223  may receive domain model  212  data from the API&#39;s  202 ,  204 , and  206  and send the data to a domain to unified modeling language (UML) model generator  210  that generates a UML model  214  that is mapped (corresponds) to the domain model  212 . Each API  202 ,  204 , and  206  may be associated with a respective domain model  212  and UML model  214 . The UML model  214  is sent to a model to graphics generator  216  that generates UML graphics  218  and sends the UML graphics  218  to the display device  104  for presentation to a user. A scoped editor  222  receives data from the API&#39;s  202 ,  204 , and  206  via the registered scoped language domain extenders  208  and sends the data to the model to graphics generator  216  that generates fly-out graphics  220  that may be sent to the display device  104 . 
     The illustrated exemplary embodiments include the use of the UML as modeling language, however the use of UML in the exemplary embodiments is merely illustrative. Any suitable alternative abstract modeling language (modeling language) and modeling language models may be similarly used in alternate embodiments. 
       FIG. 3  illustrates an exemplary embodiment of a portion of a diagram  300  that may be presented to a user on the display  104 . The diagram  300  includes a graphical shape  302  (“g_shape 1 ”) that represents a particular Java class (“customer”) model element. A hot spot  301  (“g_child”) is displayed in the graphical shape  302 . The hot spot  301  is associated with a model element, which will be described in further detail below. The diagram  300  also includes a graphical shape  306  that is similar to the graphical shape  302  described above, but represents a particular XSD class (“book”) model element. The shapes  302  and  306  are connected and visually represent a logical flow relationship of a computer code. 
     In operation, the diagram  300  includes any number of graphical shapes similar to the graphical shapes  302  and  306 . A user may use diagram  300  to analyze and manipulate computer code. The hot spot  301  is selectable by the user who may, for example, select the hot spot using an input device  106  that sends an input to the system  100  (of  FIG. 1 ). Once selected the code  303  associated with the hot spot is presented in a fly-out editor window  304 . The user may view and manipulate or edit the code  303  in the fly-out editor window  304 . If the user edits the code  303 , the edited code is synchronized with and saved in the corresponding API  202  (of  FIG. 2 ). The fly-out editor window  308  is similar to the fly-out editor window  304 . 
       FIGS. 4A and 4B  illustrate exemplary block diagram  400  detailing the generation of the diagram  300 . Referring to  FIG. 4A , the system  100  is initialized in block  402 . Scoped language domain editor extenders (for each API  202 ,  204 , and  206 ) are registered against corresponding domain model elements (e.g., d_model element 1 , d_model element 2 , . . . ), and the domain model parsers are registered against the APIs. In block  404 , a domain model construct is presented to a user in a diagram. In block  406 , the domain model (e.g., d_model) is retrieved from an API and is sent to the domain to UML mapping system. A UML model (e.g., uml_model) is generated and mapped to the domain model in block  408 . In block  410 , domain model elements are retrieved from the domain model. In block  412 , UML model elements (e.g., uml_model_element 1 , uml_model_element 2 , . . . ) are generated and associated with corresponding domain model elements. Referring to  FIG. 4B , a graphical diagram (class diagram) is generated including shapes (e.g., g_shape) associated with (and corresponding to) the UML model in block  414 . In block  416 , user input hot spots are generated (e.g., g_child 1 , g_child 2 , . . . ) and are associated with UML model elements. The shapes and hot spots are displayed in block  418 . 
       FIGS. 5A and 5B  illustrate exemplary block diagram  500  detailing the generation and display of fly-out editor windows ( 304  and  308 ). Referring to  FIG. 5A , in block  502 , a user input is received. The user input may include, for example, a user selecting a hot spot (item) (g_child 1 ) in the diagram  300  (of  FIG. 3 ). In block  504  the UML model element (uml_model_element 1 ) associated with the selected item is identified and retrieved from the UML model (uml_model). The domain model element associated with the UML model element is retrieved from the domain model (d_model) in block  506 . In block  508 , if a code editor is not registered for the domain model element, then in block  510  the domain code associated with the domain element may be displayed in a separate text editor window, such as a default or simple text editor (not shown). If a code editor is registered for the domain model element, the domain model and the domain model element are sent to the registered extender in block  512 . In block  514  a scoped editor is generated that displays text (code) associated with the domain model element in a fly out editor window. The scoped editor displays only the code associated with the identified domain model element. The user may modify the displayed code in the context of the entire domain model. For example, user actions or inputs in the scoped editor may result in feedback and/or content assistance from associated fields and elements in the domain model (that may or may not be presented to the user in the scoped editor). In block  516 , if the user has modified or edited the text in the fly-out editor window, then the modified text is sent to the domain model, and in block  518 , the domain model is synchronized with the modified text. 
     The technical effects and benefits of the methods and systems described above, allow a diagram that includes elements from any number and variety of source code domains and API&#39;s to be presented simultaneously to a user. The user may select one or more elements (including elements with dissimilar source code domain types) in the presented diagram, which generates a fly-out editor corresponding to the selected element. The fly-out editor only displays source code associated with the selected element (scoped code) allowing the user to quickly and easily analyze and edit the source code for the element in the context of the entire domain model. If the user edits the scoped code, the edited code is returned to the associated domain model where the code is synchronized. The user may also save the edited code in an updated domain model. 
     The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, element components, and/or groups thereof. 
     The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated 
     The flow diagrams depicted herein are just one example. There may be many variations to this diagram or the steps (or operations) described therein without departing from the spirit of the invention. For instance, the steps may be performed in a differing order or steps may be added, deleted or modified. All of these variations are considered a part of the claimed invention. 
     While the preferred embodiment to the invention had been described, it will be understood that those skilled in the art, both now and in the future, may make various improvements and enhancements which fall within the scope of the claims which follow. These claims should be construed to maintain the proper protection for the invention first described.