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 11:14]
cduncan [Introduction]
jvx:reference [2020/06/10 11:22]
cduncan [Implementation]
Line 10: Line 10:
 ====== Of Technologies and Factories ====== ====== Of Technologies and Factories ======
  
-Let’s talk about the UI layer, the implementations and the factory that powers it all.+Let’s talk about the UI layer, the implementationsand the factory that powers it all.
  
-===== The basics ​=====+===== The Basics ​=====
  
-For everyone who does not know, [[https://​sourceforge.net/​projects/​jvx/​|JVx]] allows you to write code once and run it on different GUI frameworkswithout changing your code. This is achieved by hiding the concrete GUI implementations behind our own classes, the UI classes, and providing “bindings” for different GUI frameworks behind the scenes. Such a “[[https://​en.wikipedia.org/​wiki/​Single-source_publishing|single sourcing]]” approach has many advantages, ​and just one of them is that migrating to a new GUI framework requires only the change of a single line, the one which controls which factory is used.+For everyone who does not know, [[https://​sourceforge.net/​projects/​jvx/​|JVx]] allows you to write code once and run it on different GUI frameworks without changing your code. This is achieved by hiding the concrete GUI implementations behind our own classes, the UI classes, and providing “bindings” for different GUI frameworks behind the scenes. Such a “[[https://​en.wikipedia.org/​wiki/​Single-source_publishing|single sourcing]]” approach has many advantages, one of which is that migrating to a new GUI framework requires only the change of a single line, the one which controls which factory is used.
  
-===== 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 ​which must not be 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, for us unknownsource.+[[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/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 handdescribes 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.
  
-===== Like an onion =====+===== Like an Onion =====
  
-[[https://​sourceforge.net/​projects/​jvx/​|JVx]] is separated into different layerswith the UI layer being at the top and of the most concern to users.+[[https://​sourceforge.net/​projects/​jvx/​|JVx]] is separated into different layers with the UI layer being at the top and of the most concern to users.
  
 {{:​jvx:​reference:​layers.png?​nolink|The four layers of VisionX: UI, Implementation,​ Extension and Technology.}} {{:​jvx:​reference:​layers.png?​nolink|The four layers of VisionX: UI, Implementation,​ Extension and Technology.}}
Line 30: Line 30:
 ==== Technology ==== ==== Technology ====
  
-Obviously, the first one in the chain is the so called “technology” layer. It represents the UI technologyfor example Swing, JavaFX or Vaadin, which is used to power the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application.+Obviously, the first one in the chain is the so-called “technology” layer. It represents the UI technology ​-- for example Swing, JavaFX or Vaadin ​-- that is used to power the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application.
  
-To put it into a more simple term:+To put it more simply:
  
 <code java> <code java>
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 ​which 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 optionsand changing of behaviorif necessary. From time to timethis 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]].
  
-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.+Theoreticallyone can skip this layer and directly jump to the implementation ​layer, butso farit has proven necessary (for cleanliness of the code, object structureand sanity reasons) to create a separate extension layer.
  
 <code java> <code java>
Line 48: Line 48:
 ==== Implementation ==== ==== Implementation ====
  
-After that comes the implementation layer. These implementations of the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] interfaces are the actual objects returned by the factory. This is some sort of “glue” layerit binds the technology or extended components against the interfaces which are provided by [[https://​sourceforge.net/​projects/​jvx/​|JVx]].+After that comes the implementation layer. These implementations of the [[https://​sourceforge.net/​projects/​jvx/​|JVx]] interfaces are the actual objects returned by the factory. This is some sort of “glue” layerit binds the technology or extended components against the interfaces which are provided by [[https://​sourceforge.net/​projects/​jvx/​|JVx]].
  
 <code java> <code java>
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information