Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
jvx:reference [2020/06/10 12:20]
cduncan [Conclusion]
jvx:reference [2020/06/10 13:18]
cduncan [DataType]
Line 18: Line 18:
 ===== The Patterns ===== ===== The Patterns =====
  
-[[https://​en.wikipedia.org/​wiki/​Factory_%28object-oriented_programming%29|The factory pattern]] is an important pattern in [[https://​en.wikipedia.org/​wiki/​Object-oriented_programming|Object-oriented programming]] It empowers us to delegate the creation of objects to another object that is not known at design and/or compile time. That allows us to use objects which have not been created by us but merely “provided” to us by an unknown-to-us source.+[[https://​en.wikipedia.org/​wiki/​Factory_%28object-oriented_programming%29|The factory pattern]] is an important pattern in [[https://​en.wikipedia.org/​wiki/​Object-oriented_programming|object-oriented programming]] It empowers us to delegate the creation of objects to another object that is not known at design and/or compile time. That allows us to use objects which have not been created by us but merely “provided” to us by an unknown-to-us source.
  
 [[https://​en.wikipedia.org/​wiki/​Bridge_pattern|The bridge pattern]], on the other hand, describes a technique which wraps implementations in another implementation and forwards all or most functionality to that wrapped implementation. This allows us to mix and match functionality without the need to have it in all implementations at once. [[https://​en.wikipedia.org/​wiki/​Bridge_pattern|The bridge pattern]], on the other hand, describes a technique which wraps implementations in another implementation and forwards all or most functionality to that wrapped implementation. This allows us to mix and match functionality without the need to have it in all implementations at once.
Line 39: Line 39:
 ==== Extension ==== ==== Extension ====
  
-Next comes the extension layer. Components from the technology are extended to support needed features of [[https://​sourceforge.net/​projects/​jvx/​|JVx]]. This includes creating bindings for the databook, additional style options, and changing of behavior, if necessary. From time to time, this also includes creating components from scratch if the provided ones do not meet the needs or there simply are none with the required functionality. For the most part, we do our best that these layers can be used without [[https://​sourceforge.net/​projects/​jvx/​|JVx]],​ meaning that they represent a solitary extension to the technology. A very good example is our JavaFX implementation,​ which compiles into two separate jars, the first being the complete [[https://​sourceforge.net/​projects/​jvxfx/​|JVx/​JavaFX]] stack, the second being stand-alone JavaFX extensions that can be used in any application and without [[https://​sourceforge.net/​projects/​jvx/​|JVx]].+Next comes the extension layer. Components from the technology are extended to support needed features of [[https://​sourceforge.net/​projects/​jvx/​|JVx]]. This includes creating bindings for the databook, additional style options, and changing of behavior, if necessary. From time to time, this also includes creating components from scratch if the provided ones do not meet the needsor there simply are none with the required functionality. For the most part, we do our best that these layers can be used without [[https://​sourceforge.net/​projects/​jvx/​|JVx]],​ meaning that they represent a solitary extension to the technology. A very good example is our JavaFX implementation,​ which compiles into two separate jars, the first being the complete [[https://​sourceforge.net/​projects/​jvxfx/​|JVx/​JavaFX]] stack, the second being stand-alone JavaFX extensions that can be used in any application and without [[https://​sourceforge.net/​projects/​jvx/​|JVx]].
  
 Theoretically,​ one can skip this layer and directly jump to the implementation layer, but, so far, it has proven necessary (for cleanliness of the code, object structure, and sanity reasons) to create a separate extension layer. Theoretically,​ one can skip this layer and directly jump to the implementation layer, but, so far, it has proven necessary (for cleanliness of the code, object structure, and sanity reasons) to create a separate extension layer.
Line 168: Line 168:
 ===== Piecing It Together ===== ===== Piecing It Together =====
  
-With all this in mind, we know now that [[https://​sourceforge.net/​projects/​jvx/​|JVx]] has swapable ​implementations underneath its UI layer for each technology it utilizes:+With all this in mind, we know now that [[https://​sourceforge.net/​projects/​jvx/​|JVx]] has swappable ​implementations underneath its UI layer for each technology it utilizes:
  
 {{:​jvx:​reference:​multi-layers.png?​nolink|Multiple Extensions/​Implementations/​Technologies can be used}} {{:​jvx:​reference:​multi-layers.png?​nolink|Multiple Extensions/​Implementations/​Technologies can be used}}
Line 176: Line 176:
 ===== What else? ===== ===== What else? =====
  
-That is how [[https://​sourceforge.net/​projects/​jvx/​|JVx]] works in regards to the UI layer. It depends on “technology specific stacks” which can be swapped out and implemented for pretty much every GUI framework out there. We currently provide support for Swing, JavaFX, and Vaadin, but we also had implementations for GWT and Qt. Additionally,​ we do support a “headless” implementation which uses lightweight objects ​which can be serialized and send over the wire without much effort.+That is how [[https://​sourceforge.net/​projects/​jvx/​|JVx]] works in regards to the UI layer. It depends on “technology-specific stacks”which can be swapped out and implemented for pretty much every GUI framework out there. We currently provide support for Swing, JavaFX, and Vaadin, but we also had implementations for GWT and Qt. Additionally,​ we do support a “headless” implementationwhich uses lightweight objects ​that can be serialized and send over the wire without much effort.
  
 ===== Adding a New Technology ===== ===== Adding a New Technology =====
Line 186: Line 186:
 Even though the stack of [[https://​sourceforge.net/​projects/​jvx/​|JVx]] is more complicated compared with other GUI or application frameworks, this complexity is set off by the benefits it brings. One can change the used GUI technology without much effort and, most importantly,​ without touching the application logic at all. Even though the stack of [[https://​sourceforge.net/​projects/​jvx/​|JVx]] is more complicated compared with other GUI or application frameworks, this complexity is set off by the benefits it brings. One can change the used GUI technology without much effort and, most importantly,​ without touching the application logic at all.
  
-====== Resource and UIResource ​======+====== Resource and UI Resource ​======
  
-Let’s talk about Resources ​and UIResources, ​and why they sound similar ​but are not the same.+Let’s talk about resources ​and UI resources ​and why they sound similar ​yet are not the same.
  
 ===== The Basics ===== ===== The Basics =====
  
-We’ve [[#​encapsulated_by_a_wrapper_class|encapsulated by a wrapper class]]. ​An UIResource” on the other hand is an encapsulated concrete implementation of one of the interfaces on the UI layer.+We’ve [[#​encapsulated_by_a_wrapper_class|encapsulated by a wrapper class]]. ​UI resourceon the other handis an encapsulated concrete implementation of one of the interfaces on the UI layer.
  
-Let’s do a short brush-up on how the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] architecture looks like in regards to the GUI stack:+Let’s do a short overview of how the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] architecture looks like in regards to the GUI stack:
  
-{{:​jvx:​reference:​resource.png?​nolink|The JVx layers revisited. UI-Wrapper ​and Implementation ​implement the interface, ​Extension ​and Technology ​do not.}}+{{:​jvx:​reference:​resource.png?​nolink|The JVx layers revisited. UI wrapper ​and implementation ​implement the interface, ​extension ​and technology ​do not.}}
  
-The UI Wrappers ​are the main UI classes ​which are used to create the GUI (f.e. ''​%%UIButton%%''​). These are wrapping the Implementations ​(f.e. ''​%%SwingButton%%''​) which themselves are wrapping the Extension/Technology ​(f.e. a ''​%%JVxButton%%''/''​%%JButton%%''​). Only the UI and Implementation ​classes ​are implementing the interface are required for the component (f.e. ''​%%IButton%%''​). That also means that the Implementation ​is dependent on the Extension/Technology ​component, but the UI can use any object which implements the interface.+The UI wrappers ​are the main UI classes ​that are used to create the GUI (f.e. ''​%%UIButton%%''​). These are wrapping the implementations ​(f.e. ''​%%SwingButton%%''​)which themselves are wrapping the extension/technology ​(f.e. a ''​%%JVxButton%%''/''​%%JButton%%''​). Only the UI and implementation ​classes implementing the interface are required for the component (f.e. ''​%%IButton%%''​). That also means that the implementation ​is dependent on the extension/technology ​component, but the UI can use any object which implements the interface.
  
-Now, with that knowledge we can start defining what is what:+Now, with that knowledgewe can start defining what is what:
  
-{{:​jvx:​reference:​resource2.png?​nolink|The UI-Wrapper ​is the uicomponent, the Implementation ​is the uiresource ​and the Extension ​and Technology ​are the resource.}}+{{:​jvx:​reference:​resource2.png?​nolink|The UI wrapper ​is the  UI component, the implementation ​is the UI resource, ​and the extension ​and technology ​are the resource.}}
  
-The resource itself, accessed by calling ''​%%<​uiwrapper>​.getResource()%%'',​ is the Extension/Technology ​component. The uiresource ​can be accessed by calling ''​%%<​uiwrapper>​.getUIResource()%%''​. The uicomponent ​can be accessed by calling ''​%%<​uiwrapper>​.getUIComponent()%%''​ and is usually the UI Wrapper ​class itself. If we use our previous Swing example, the resource would be a ''​%%JVxButton%%''/''​%%JButton%%'',​ the uiresource ​would be the ''​%%SwingButton%%''​ and the uicomponent ​would be the ''​%%UIButton%%''​.+The resource itself, accessed by calling ''​%%<​uiwrapper>​.getResource()%%'',​ is the extension/technology ​component. The  UI resource ​can be accessed by calling ''​%%<​uiwrapper>​.getUIResource()%%''​. The UI component ​can be accessed by calling ''​%%<​uiwrapper>​.getUIComponent()%%''​ and is usually the UI wrapper ​class itself. If we use our previous Swing example, the resource would be a ''​%%JVxButton%%''/''​%%JButton%%'',​ the  UI resource ​would be the ''​%%SwingButton%%''​ and the UI component ​would be the ''​%%UIButton%%''​.
  
-As one can see, access to all objects which are comprising the GUI is at all times possible. We, of course, have the UI component, we can access the Implementation ​component and we can access the Extension/Technology ​component. Theoretically we could also swap them at runtime, but in [[https://​sourceforge.net/​projects/​jvx/​|JVx]] this is limited to the construction of the object to greatly reduce the error potential and complexity of the framework code.+As one can see, access to all objects which comprise ​GUI possible ​at all times. We, of course, have the UI component, we can access the implementation ​componentand we can access the extension/technology ​component. Theoreticallywe could also swap them at runtime, but in [[https://​sourceforge.net/​projects/​jvx/​|JVx]]this is limited to the construction of the object to greatly reduce the error potential and complexity of the framework code.
  
-===== Creating ​custom components ​=====+===== Creating ​Custom Components ​=====
  
-We will use an example from the [[#​part_about_creating_custom_components|part about creating custom components]] which we will come to later. The ''​%%BeepComponent%%''​ is a simple ''​%%UIComponent%%''​ extension which contains a label and two buttons inside itself.+We will use an example from the [[#​part_about_creating_custom_components|part about creating custom components]]which we will come to later. The ''​%%BeepComponent%%''​ is a simple ''​%%UIComponent%%''​ extension which contains a label and two buttons inside itself.
  
 <code java> <code java>
Line 234: Line 234:
 } }
 </​code>​ </​code>​
-We are setting a new UIResource ​(an ''​%%UIPanel%%''​) in the constructor (at line #5) which is to be used by the ''​%%UIComponent%%''​. In this case it is not an Implementation, but another UI component, ​but that doesn’t matter because the UIResource ​only must implement the expected interface. At line #15 we start using that custom ​UIResource.+We are setting a new UI resource ​(''​%%UIPanel%%''​) in the constructor (at line #5) that is to be used by the ''​%%UI component%%''​. In this caseit is not an implementation, but another UI component. However, that doesn’t matter because the UI resource ​only must implement the expected interface. At line #15 we start using that custom ​UI resource.
  
-Because ​UIComponent ​is an abstract component designed for exactly this usage, the example might not be the most exciting one, but it clearly illustrates the mechanic.+Because ​UI component ​is an abstract component designed for exactly this usage, the example might not be the most exciting one, but it clearly illustrates the mechanic.
  
-===== Bolting on functionality ​=====+===== Bolting on Functionality ​=====
  
-Also from from the [[#​part_about_creating_custom_components|part about creating custom components]] we can reuse the ''​%%PostfixedLabel%%''​ as example:+Alsofrom the [[#​part_about_creating_custom_components|part about creating custom components]]we can reuse the ''​%%PostfixedLabel%%''​ as example:
  
 <code java> <code java>
Line 251: Line 251:
 }; };
 </​code>​ </​code>​
-Now ''​%%testLabel%%''​ will be using the ''​%%PostfixedLabel%%''​ internallybut with no indication to the user of the object that this is the case. This allows to extend the functionality of a component completely transparently,​ especially in combination with functions ​which do return ​an ''​%%UIComponent%%''​ and similar.+Now ''​%%testLabel%%''​ will be using the ''​%%PostfixedLabel%%''​ internally but with no indication to the user of the object that this is the case. This allows ​us to extend the functionality of a component completely transparently,​ especially in combination with functions ​that return ​''​%%UI component%%''​ and similar.
  
-===== An important note about the component hierarchy ​=====+===== An Important Note About the Component Hierarchy ​=====
  
 If we create a simple component extensions, like the ''​%%BeepComponent%%''​ above, it is important to note that there is one other layer of indirection in regards to the hierarchy on the technology layer. If we create a simple frame with the ''​%%BeepComponent%%''​ in it, one might expect the following hierarchy: If we create a simple component extensions, like the ''​%%BeepComponent%%''​ above, it is important to note that there is one other layer of indirection in regards to the hierarchy on the technology layer. If we create a simple frame with the ''​%%BeepComponent%%''​ in it, one might expect the following hierarchy:
Line 268: Line 268:
                                         \-Button                                         \-Button
 </​code>​ </​code>​
-With the BeepComponent added and its sub-components ​as its children. However, the actual hierarchy looks like this:+with the BeepComponent added and its subcomponents ​as its children. However, the actual hierarchy looks like this:
  
 <​code>​ <​code>​
Line 280: Line 280:
                                     \-Button                                     \-Button
 </​code>​ </​code>​
-That is because such extended components are not “passed” to the Technology, ​they do only exist on the UI layer because they do not have a Technology component which could be used. That is done by adding the ''​%%UIComponent%%''​ to the UI parent, but for adding the actual ​Technology ​component the set UIResource ​is used.+That is because such extended components are not “passed” to the technology; ​they only exist on the UI layer because they do not have a Technology component which could be used. That is done by adding the ''​%%UI component%%''​ to the UI parent, but for adding the actual ​technology ​component the set UI resource ​is used.
  
-===== The special case of containers ​=====+===== The Special Case of Containers ​=====
  
-Another special case are containers. For example we could create a panel which does display ​an overlay in certain situations and we will need to use that throughout the whole application.+Another special case is containers. For examplewe could create a panel that displays ​an overlay in certain situationsand we will need to use that throughout the whole application.
  
 {{:​jvx:​reference:​uiresourcecontainer.png?​nolink|UIResourceContainer Example}} {{:​jvx:​reference:​uiresourcecontainer.png?​nolink|UIResourceContainer Example}}
  
-That means we do not want to build it every time anew, so one option would be to use a factory method to “wrap” the content, something ​like this:+That means we do not want to build it every time anew, so one option would be to use a factory method to “wrap” the content. Something ​like this:
  
 <code java> <code java>
Line 333: Line 333:
 } }
 </​code>​ </​code>​
-Which is easy enough, but let’s say we’d like to add logic to that wrapper, at that point it becomes more complicated. We can’t use the same technique as for custom component from abovebecause in that case the “overlaying panel” would simply not be displayed. However, there is a similar mechanism for containerssetting the UIResourceContainer.+Which is easy enough, but let’s say we’d like to add logic to that wrapper. At that pointit becomes more complicated. We can’t use the same technique as the custom component from above becausein that casethe “overlaying panel” would simply not be displayed. However, there is a similar mechanism for containerssetting the UI resource container.
  
-The UIResourceContainer ​is another special mechanism ​which works similar to setting the UIResource, but it works exactly the other way round. While setting the UIResource does hide” components from the Technology which are there in UI layer, setting the UIResourceContainer does hide components from the UI layer while there are added in the Technology. A little ​bit complicated,​ here is our example ​again using this technique:+The UI resource container ​is another special mechanism ​that works similar to setting the UI resource, but it works exactly the other way round. While setting the UI resource ​hides” components from the technology ​in UI layer, setting the UI resource container hides components from the UI layerwhile they are added in the technology. A little complicated,​ here is our example using this technique ​again:
  
 <code java> <code java>
Line 363: Line 363:
 } }
 </​code>​ </​code>​
-What we’ve done is extend ​an UIPanel ​(line #1), setting it up and adding children and then we’ve declared one of its children as the UIResourceContainer ​(line #22). So all methods ​which are specific to IContainer ​(adding children, setting a layout, etc.) are now forwarding to the innerPanel ​and manipulating the contents of the OverlayedPanel directly is not directly ​available.+What we’ve done is extend ​a  UI panel (line #1), setting it up and adding childrenand then we’ve declared one of its children as the UI resource container ​(line #22). So all methods ​that are specific to UI container ​(adding children, setting a layout, etc.) are now forwarding to the inner panel and manipulating the contents of the overlaid panel directly.
  
 And here is how it is used: And here is how it is used:
Line 387: Line 387:
 parentContainer.add(panel,​ UIBorderLayout.CENTER);​ parentContainer.add(panel,​ UIBorderLayout.CENTER);​
 </​code>​ </​code>​
-Notice that we can use it is any other panel (line #5) and simply add it to the parent (line #18). For a user of the API it is transparent as to whether there are more components or not, this is also visible in the created component hierarchy:+Notice that we can use it as any other panel (line #5) and simply add it to the parent (line #18). For a user of the APIit is transparent as to whether there are more components or not. This is also visible in the created component hierarchy:
  
 <​code>​ <​code>​
Line 413: Line 413:
 Because of the way the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] framework is designed, it is easy to access all layers of the GUI framework and also facilitate the usage of these layers to create custom components and allow easy access to the wrapped components, no matter on what layer or of what kind they are. Because of the way the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] framework is designed, it is easy to access all layers of the GUI framework and also facilitate the usage of these layers to create custom components and allow easy access to the wrapped components, no matter on what layer or of what kind they are.
  
-====== Launchers and Applications ​======+====== Launchers and applications ​======
  
 Let’s talk about Launchers, and how they are used to start [[https://​sourceforge.net/​projects/​jvx/​|JVx]] applications. Let’s talk about Launchers, and how they are used to start [[https://​sourceforge.net/​projects/​jvx/​|JVx]] applications.
Line 426: Line 426:
 Then, and only then, the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application can run. Depending on the implementation that is used, that can be as easily as instancing the factory (Swing, JavaFX), but can also mean that a servlet server has to start (Vaadin). Because we do not wish to encumber our applications with technology specific code, we have to entrust all this to an encapsulated entity, meaning the implementations of ''​%%ILauncher%%''​ and ''​%%IApplication%%''​. Then, and only then, the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application can run. Depending on the implementation that is used, that can be as easily as instancing the factory (Swing, JavaFX), but can also mean that a servlet server has to start (Vaadin). Because we do not wish to encumber our applications with technology specific code, we have to entrust all this to an encapsulated entity, meaning the implementations of ''​%%ILauncher%%''​ and ''​%%IApplication%%''​.
  
-===== Following the chain =====+===== Following the Chain =====
  
 The steps for getting an application to start are as follows: The steps for getting an application to start are as follows:
  
-  * The first thing that must run is obviously the JVM, without ​it we won’t have much luck starting anything. +  * The first thing that must run isobviouslythe JVM. Without ​itwe won’t have much luck starting anything! 
-  * The launcher must be created and it must start the Technology+  * The launcher must be createdand it must start the technology
-  * The launcher ​than creates the application which the user is seeing.+  * The launcher ​then creates the applicationwhich the user is seeing.
  
 {{:​jvx:​reference:​launcher.png?​nolink|First the JVM starts, then the ILauncher (the window) and finally the IApplication (the content).}} {{:​jvx:​reference:​launcher.png?​nolink|First the JVM starts, then the ILauncher (the window) and finally the IApplication (the content).}}
  
-So we need two classes, the ''​%%ILauncher%%''​ implementation ​which knows how to start the Technology ​and the ''​%%IApplication%%''​ implementation. That we already knew, so let’s try to put this into code. For simplicity reasons (and because I don’t want to write a complete factory from scratch for this example) we will reuse the Swing implementation and write a new launcher and application for it.+So we need two classes, the ''​%%ILauncher%%''​ implementation ​that knows how to start the technology ​and the ''​%%IApplication%%''​ implementation. That we already knew, so let’s try to put this into code. For simplicity reasons (and because I don’t want to write a complete factory from scratch for this example)we will reuse the Swing implementation and write a new launcher and application for it.
  
-===== Entry point =====+===== Entry Point =====
  
-The ''​%%Main%%''​ class that we will use as example is very straightforward:​+The ''​%%main%%''​ class that we will use as example is very straightforward:​
  
 <code java> <code java>
Line 457: Line 457:
 } }
 </​code>​ </​code>​
-All we have to do there is start the launcher itself. As the comment suggests, there might be work required for a “real” application startup. For this example, it is all we need to do. Of course we could also directly embed this little function into the launcher implementation itselfto save us one class.+All we have to do there is start the launcher itself. As the comment suggests, there might be work required for a “real” application startup. For this example, it is all we need to do. Of coursewe could also directly embed this little function into the launcher implementation itself to save us one class.
  
-===== The launcher ​=====+===== The Launcher ​=====
  
-The ''​%%ILauncher%%''​ implementation on the other hand contains quite some logicbut nothing not manageable:+The ''​%%ILauncher%%''​ implementationon the other handcontains quite some logic but nothing not manageable:
  
 <code java> <code java>
Line 540: Line 540:
 } }
 </​code>​ </​code>​
-In short, the launcher is kicking off the Swing thread by invoking the startup method on the main Swing thread. This startup method will instantiate the factory and then create the application. From there we only need to set it visible and then our application has started.+In short, the launcher is kicking off the Swing thread by invoking the startup method on the main Swing thread. This startup method will instantiate the factory and then create the application. From therewe only need to set it to visible and then our application has started.
  
-The launcher extends from ''​%%SwingFrame%%''​, that is required because there hasn’t been a factory created yet which could be used by UI components to create themselves. If we’d try to use an UI component before creating/​setting a factory, we would obviously ​see the constructor of the component fail with a ''​%%NullPointerException%%''​.+The launcher extends from ''​%%SwingFrame%%''​. That is required because there hasn’t been a factory created yet that could be used by UI components to create themselves. If we’d try to use an UI component before creating/​setting a factory, we would see the constructor of the component fail with a ''​%%NullPointerException%%''​.
  
-The method ''​%%startup()%%''​ is invoked on the main Swing thread, which also happens to be the main UI thread for [[https://​sourceforge.net/​projects/​jvx/​|JVx]] in this application. Once we are on the main UI thread we can create the application,​ add it and then set everything to visible.+The method ''​%%startup()%%''​ is invoked on the main Swing thread, which also happens to be the main UI thread for [[https://​sourceforge.net/​projects/​jvx/​|JVx]] in this application. Once we are on the main UI threadwe can create the application,​ add itand then set everything to visible.
  
-===== The application ​=====+===== The Application ​=====
  
-The ''​%%IApplication%%''​ implementation is quite shortbecause we extend ''​%%com.sibvisions.rad.application.Application%%'',​ an ''​%%IApplication%%''​ implementation created with UI components.+The ''​%%IApplication%%''​ implementation is quite short because we extend ''​%%com.sibvisions.rad.application.Application%%'',​ an ''​%%IApplication%%''​ implementation created with UI components.
  
 <code java> <code java>
Line 572: Line 572:
 } }
 </​code>​ </​code>​
-Because the launcher has previously started the technology and created the factory we can from here on now use UI components, which means we are already independent of the underlying technology. So the ''​%%IApplication%%''​ implementation can already be used with different technologies and is completely independent.+Because the launcher has previously started the technology and created the factorywe can now use UI components, which means we are already independent of the underlying technology. Sothe ''​%%IApplication%%''​ implementation can already be used with different technologies and is completely independent.
  
-===== Notes on the launcher ​=====+===== Notes on the Launcher ​=====
  
-As you might have noticed, in our example the launcher is a (window) frame, that makes sense for nearly every desktop GUI toolkit as they all depend upon a window as main method to display their applications. But the launcher could also be simplerfor example just a call to start the GUI thread. Or it could be something completely differentfor example an incoming HTTP request.+As you might have noticed, in our example the launcher is a (window) frame. That makes sense for nearly every desktop GUI toolkit as they all depend upon a window as main method to display their applications. But the launcher could also be simplerfor examplejust a call to start the GUI thread. Or it could be something completely differentfor examplean incoming HTTP request.
  
-Also don’t forget that the launcher is providing additional functionality to the application,​ like saving file handles, reading and writing the configuration and similar platform and toolkit dependent operations, see the [[https://​sourceforge.net/​p/​jvx/​code/​HEAD/​tree/​trunk/​java/​swing/​src/​com/​sibvisions/​rad/​ui/​swing/​impl/​SwingApplication.java|launcher for Swing for further details]].+Alsodon’t forget that the launcher is providing additional functionality to the application,​ like saving file handles, reading and writing the configurationand similar platform and toolkit-dependent operations. See the [[https://​sourceforge.net/​p/​jvx/​code/​HEAD/​tree/​trunk/​java/​swing/​src/​com/​sibvisions/​rad/​ui/​swing/​impl/​SwingApplication.java|launcher for Swing for further details]].
  
 ===== Conclusion ===== ===== Conclusion =====
Line 590: Line 590:
 ===== What is it? ===== ===== What is it? =====
  
-DataBooks are an active model, which allow you to directly query and manipulate the data. Contrary to many other systems [[https://​sourceforge.net/​projects/​jvx/​|JVx]] does not map the data into objects, but instead ​allows you to directly access it in a table like fashionexposing columns, rows and values.+DataBooks are an active model, which allow you to directly query and manipulate the data. Contrary to many other systems[[https://​sourceforge.net/​projects/​jvx/​|JVx]] does not map the data into objects, but allows you to directly access it in a table-like fashion exposing columns, rowsand values.
  
-One could say that it is like a three dimensional arraywith these dimensions:+One could say that it is like a three dimensional array with these dimensions:
  
   * DataPages   * DataPages
Line 598: Line 598:
   * Columns/​Values   * Columns/​Values
  
-With DataPages containing DataRows, which itself ​contain the values and everything ​is referencing the RowDefinition,​ which outlines how a row looks like.+with DataPages containing DataRows, which in turn contain the values and everything referencing the RowDefinition,​ which further ​outlines how a row looks like.
  
 {{:​jvx:​reference:​databook.png?​nolink|DataBook Architecture,​ the DataBook contains DataPages, which contain DataRows.}} {{:​jvx:​reference:​databook.png?​nolink|DataBook Architecture,​ the DataBook contains DataPages, which contain DataRows.}}
Line 616: Line 616:
 dataBook.setRowDefinition(rowDefinition);​ dataBook.setRowDefinition(rowDefinition);​
 </​code>​ </​code>​
-==== ColumnDefinition ​====+==== Column Definition ​====
  
-The ColumnDefinition ​defines and provides all necessary information about the column, like its DataType, its size and if it is nullable or not. You can think of it as one column in a table.+The column definition ​defines and provides all necessary information about the column, like its  ​datatype, its sizeand whether ​it is nullable or not. You can think of it as one column in a table.
  
 <code java> <code java>
Line 624: Line 624:
 columnDefinition.setNullable(false);​ columnDefinition.setNullable(false);​
 </​code>​ </​code>​
-==== MetaData ​====+==== Metadata ​====
  
-Most of the ColumnDefinition ​is additional information about the column, like if it is nullable, the label of the column, default values, allowed values and similar information.+Most of the column definition ​is additional information about the column, like if it is nullable, the label of the column, default values, allowed valuesand similar information.
  
-==== DataType ​====+==== Datatype ​====
  
-Of course we must define what type the value in the column has, this is done by setting a DataType ​on the ColumnDefinition. The DataType ​defines what kind of values the column holds, like if it is a String, ​or a Number or something else. We do provide the most often used DataTypes ​out of the box:+Of coursewe must define what type the value in the column has. This is done by setting a datatype ​on the column definition. The datatype ​defines what kind of values the column holds, like if it is a String, a Numberor something else. We provide the most often used datatypes ​out of the box:
  
   * BigDecimal   * BigDecimal
Line 640: Line 640:
   * Timestamp   * Timestamp
  
-It is possible to add new DataTypes ​by simply implementing ''​%%IDataType%%''​.+It is possible to add new datatypes ​by simply implementing ''​%%IDataType%%''​.
  
 ===== DataRow ===== ===== DataRow =====
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information