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/15 08:48]
cduncan [RowDefinition]
jvx:reference [2020/06/15 09:49]
cduncan [The Simplest JVx Application: Just the GUI]
Line 584: Line 584:
 This example demonstrates how a simple launcher is implemented and why it is necessary to have a launcher in the first place. Compared with the “[[#​jvx|JVx]] are of course a lot more complex than these examples, that is because they implement all the required functionality and also take care of a lot of boiler plate operations. It is taking care of all technology specific code and allows to keep your application free from knowing about the platform it runs on. This example demonstrates how a simple launcher is implemented and why it is necessary to have a launcher in the first place. Compared with the “[[#​jvx|JVx]] are of course a lot more complex than these examples, that is because they implement all the required functionality and also take care of a lot of boiler plate operations. It is taking care of all technology specific code and allows to keep your application free from knowing about the platform it runs on.
  
-====== ​DataBooks ​======+====== ​Data Books ======
  
-Let’s talk about DataBooks, which allow access to data without any effort.+Let’s talk about data books, which allow access to data without any effort.
  
 ===== What is it? ===== ===== What is it? =====
Line 624: Line 624:
 columnDefinition.setNullable(false);​ columnDefinition.setNullable(false);​
 </​code>​ </​code>​
-==== MetaData ​====+==== Meta Data ====
  
 Most of the column definition 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 values, and similar information.
  
-==== DataType ​====+==== Data Type ====
  
-Of course, we must define what type the value in the column has. This is done by setting a data type on the column definition. The data type defines what kind of values the column holds, like if it is a String, a Number, or something else. We provide the most often used data types out of the box:+Of course, we must define what type the value in the column has. This is done by setting a data type on the column definition. The data type defines what kind of values the column holds, like if it is a string, a number, or something else. We provide the most often used data types out of the box:
  
   * BigDecimal   * BigDecimal
Line 642: Line 642:
 It is possible to add new data types by simply implementing ''​%%IDataType%%''​. It is possible to add new data types by simply implementing ''​%%IDataType%%''​.
  
-===== DataRow ​=====+===== Data Row =====
  
 The data row represents a single row of data; it holds/​references its own row definition and, of course, provides access to the values of the row. Accessing the  data row can be done either by column index or column name, and the methods either return or accept objects. Let’s look at a simple usage example: The data row represents a single row of data; it holds/​references its own row definition and, of course, provides access to the values of the row. Accessing the  data row can be done either by column index or column name, and the methods either return or accept objects. Let’s look at a simple usage example:
Line 653: Line 653:
 dataRow.setValue("​COLUMN_A",​ "New Value"​);​ dataRow.setValue("​COLUMN_A",​ "New Value"​);​
 </​code>​ </​code>​
-===== DataPage ​=====+===== Data Page =====
  
-The data page is basically a list of data rows, it also holds its own row definition, which is shared with all the contained data rows.+The data page is basically a list of data rows. It also holds its own row definition, which is shared with all the contained data rows.
  
-The main usage of data pages is to allow paging in a master/​detail relationship. If the master selects a different row, the detail ​databook ​selects the related data page.+The main usage of data pages is to allow paging in a master/​detail relationship. If the master selects a different row, the detail ​data book selects the related data page.
  
-===== DataBook ​=====+===== Data Book =====
  
 The data book is the main model of [[https://​sourceforge.net/​projects/​jvx/​|JVx]],​ it provides direct access to its current data page and data row by extending from IDataRow and IDataPage. The data book is the main model of [[https://​sourceforge.net/​projects/​jvx/​|JVx]],​ it provides direct access to its current data page and data row by extending from IDataRow and IDataPage.
Line 667: Line 667:
 ===== Usage Example ===== ===== Usage Example =====
  
-Here is a simple example of a ''​%%MemDataBook%%'',​ an ''​%%IDataBook%%''​ implementation ​which only operates in memory:+Here is a simple example of a ''​%%MemDataBook%%'',​ an ''​%%IDataBook%%''​ implementation ​that only operates in memory:
  
 <code java> <code java>
Line 716: Line 716:
   * Binary Data   * Binary Data
  
-Text and binary data are both objects (arrays of primitives are objects after all) and numbers are either primitives or objects. Most of the time, if we deal with numbers inside a database, we want them to be of arbitrary precision, which means we must represent them as ''​%%BigDecimal%%''​. Supporting ''​%%double%%''​ or ''​%%float%%''​ in these cases would be dangerous because one might write a ''​%%float%%''​ into the database [[https://​en.wikipedia.org/​wiki/​Floating-point_arithmetic|which might or might not end up with the correct value]] in the database. To completely eliminate such problems, we only support objects, which means that one is “limited” to the usage of number extensions like ''​%%BigLong%%''​ and ''​%%BigDecimal%%'',​ which do not suffer from such problems.+Text and binary data are both objects (arrays of primitives are objects after all) and numbers are either primitives or objects. Most of the time, if we deal with numbers inside a database, we want them to be of arbitrary precision, which means we must represent them as ''​%%BigDecimal%%''​. Supporting ''​%%double%%''​ or ''​%%float%%''​ in these cases would be dangerous because one might write a ''​%%float%%''​ into the database [[https://​en.wikipedia.org/​wiki/​Floating-point_arithmetic|which might or might not end up with the correct value]] in the database. To completely eliminate such problems, we only support objects, which means that one is “limited” to the usage of number extensions like ''​%%BigLong%%''​ and ''​%%BigDecimal%%'',​ which do not suffer from such problems.
  
 ==== Where Are the Data Pages? ==== ==== Where Are the Data Pages? ====
Line 724: Line 724:
 ===== Master/​Detail ===== ===== Master/​Detail =====
  
-[[https://​en.wikipedia.org/​wiki/​Master%E2%80%93detail_interface#​Data_model|Master/​detail]] is something that occurs in nearly every data model. It means simply that there is one master ​dataset which is referenced by one or multiple detail ​datasets. Or to express it in SQL:+[[https://​en.wikipedia.org/​wiki/​Master%E2%80%93detail_interface#​Data_model|Master/​detail]] is something that occurs in nearly every data model. It simply ​means that there is one master ​data set that is referenced by one or multiple detail ​data sets. Or to express it in SQL:
  
 <code sql> <code sql>
Line 733: Line 733:
   left join DETAIL d on m.ID=d.MASTER_ID;​   left join DETAIL d on m.ID=d.MASTER_ID;​
 </​code>​ </​code>​
-We can of course express a master/​detail relationship when using data books. For that we just create a ''​%%ReferenceDefinition%%''​ and assign it to the detail data book:+We canof courseexpress a master/​detail relationship when using data books. For thatwe just create a ''​%%ReferenceDefinition%%''​ and assign it to the detail data book:
  
 <code java> <code java>
Line 767: Line 767:
                    ​8| ​        3                    ​8| ​        3
 </​code>​ </​code>​
-Now if we select the second row in the ''​%%masterDataBook%%'',​ the ''​%%detailDataBook%%''​ will just contain the rows with the corresponding ''​%%MASTER_ID%%'',​ so 3, 4 and 5.+Nowif we select the second row in the ''​%%masterDataBook%%'',​ the ''​%%detailDataBook%%''​ will just contain the rows with the corresponding ''​%%MASTER_ID%%'',​ so 3, 4and 5.
  
 <​code>​ <​code>​
Line 778: Line 778:
      ​3 ​            ​5| ​        2      ​3 ​            ​5| ​        2
 </​code>​ </​code>​
-The ''​%%detailDataBook%%''​ is automatically adjusted according to the selection in the ''​%%masterDatabook%%''​. Of course this can have an arbitrary depthtoo.+The ''​%%detailDataBook%%''​ is automatically adjusted according to the selection in the ''​%%masterDatabook%%''​. Of coursethis can have an arbitrary depth too.
  
 ===== Conclusion ===== ===== Conclusion =====
  
-The data book is the backbone of [[https://​sourceforge.net/​projects/​jvx/​|JVx]]it provides a clean and easy way to access and manipulate data. At the same time, it is flexible and can be customized to specific needs with ease.+The data book is the backbone of [[https://​sourceforge.net/​projects/​jvx/​|JVx]]it provides a clean and easy way to access and manipulate data. At the same time, it is flexible and can be customized to specific needs with ease.
  
 ====== Application Basics ====== ====== Application Basics ======
  
-Let’s talk about the basicshow a [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application starts, works and how the connection strings together the client and server side.+Let’s talk about the basicshow a [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application starts, ​how it worksand how the connection strings together the client and server side.
  
 ===== Multitier Architecture ===== ===== Multitier Architecture =====
Line 817: Line 817:
 frame.eventWindowClosed().addListener(() -> System.exit(0));​ frame.eventWindowClosed().addListener(() -> System.exit(0));​
 </​code>​ </​code>​
-We can start to create and manipulate the GUI. In this case we are building a simple window with a label inside. ​Last but not least, we make sure that the JVM will exit when the window is closed.+We can start to create and manipulate the GUI. In this casewe are building a simple window with a label inside. ​Lastly, we make sure that the JVM will exit when the window is closed.
  
 A very good example and showcase for that is the [[https://​github.com/​sibvisions/​jvx.kitchensink|JVx Kitchensink]]. A very good example and showcase for that is the [[https://​github.com/​sibvisions/​jvx.kitchensink|JVx Kitchensink]].
  
-That’s itThat is the most simple way to start a [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application. We can use all controls, and we can use ''​%%MemDataBook%%''​s without any problem or limitation. Best of all, we can simply switch to another technology by using another factory.+That’s itThat is the most simple way to start a [[https://​sourceforge.net/​projects/​jvx/​|JVx]] application. We can use all controls, and we can use ''​%%MemDataBook%%''​s without any problem or limitation. Best of all, we can simply switch to another technology by using another factory.
  
 ===== Anatomy of a remote JVx application ===== ===== Anatomy of a remote JVx application =====
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information