Servoy 8.0.0 beta 1

Release notes for Servoy betas

Re: Servoy 8.0.0 beta 1

Postby juan.cristobo » Fri Apr 17, 2015 8:39 am

Are you planning to include sample webcomponents and sample NG solutions in the installer?
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 186
Joined: Thu Apr 19, 2012 9:12 am

Re: Servoy 8.0.0 beta 1

Postby logicimpresa » Fri Apr 17, 2015 2:59 pm

+1
Gianluca Zanini
Logic Impresa - Italy
SAN Partner
Best BAP development 2014
Eager Beaver 2013
Servoy Valued Professional 2012
User avatar
logicimpresa
 
Posts: 65
Joined: Sun May 01, 2011 3:58 pm
Location: Bernate Ticino (MI) - Italy

Re: Servoy 8.0.0 beta 1

Postby jcarlos » Fri Apr 17, 2015 9:38 pm

Should they make it so you can deploy on any framework you want...sure, that would be cool, but its not really why people choose Servoy....IMHO.


I agree.

Also:

#1. currently, there is a whole lot of demand for front-end design/production and a scarcity of resources, so you might have trouble finding good people who are free and available to help you build the front-end. Servoy takes that problem away -not to mention the cost to develop a front-end.

#2. David: the Velocity Report plugin/Velocity Web client can help you. Configure it, and you'll get just JSON objects that you can use. You did't need to wait for Servoy 8. Velocity can be your data proxy of Servoy's foundsets and records!
Juan-Carlos Sanchez, Stanford University - Law and Economics
jcarlos
 
Posts: 578
Joined: Thu May 04, 2006 8:55 pm
Location: Palo Alto, California USA

Re: Servoy 8.0.0 beta 1

Postby mboegem » Sat Apr 18, 2015 10:42 am

jcarlos wrote:#1. currently, there is a whole lot of demand for front-end design/production and a scarcity of resources, so you might have trouble finding good people who are free and available to help you build the front-end. Servoy takes that problem away -not to mention the cost to develop a front-end.

#2. David: the Velocity Report plugin/Velocity Web client can help you. Configure it, and you'll get just JSON objects that you can use. You did't need to wait for Servoy 8. Velocity can be your data proxy of Servoy's foundsets and records!


+1

The good thing about #2 is that it is highly configurable, so you can basically choose how your back-end will behave:
3 levels of headless client instantiation (per solution):
 application (one headless client to rule them all!)
 pool (just like the REST plugin, but much better!)
 session (one headless client per HTTP session)

 In session mode, your session is stateful
 (Actually it can be stateful also in any mode...


source: http://www.servoycamp.com/images/camp14 ... ypower.pdf
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Servoy 8.0.0 beta 1

Postby david » Mon Apr 20, 2015 3:37 am

Just so we're talking about the same things, a digression:

1. Velocity Web Client is an apple — the server is the lead:

a. browser sends request
b. logic runs on server: context/data + template + code to combine
c. entire response sent back to browser (html merged with data) is sent back to the browser

There is no data broadcasting between clients like you're used to in standard Servoy clients (other realtime: RethinkDB, Firebase, Meteor, Derby). You have to roll your own AJAXy stuff like any other web technology to update your UI when data changes.

2. NG Client is an orange — the browser is the lead:

a. browser sends request
b. server responds with lots of html templates and lots of code
c. browser runs the returned code: requests data from server, combines data results from server with the html templates, and finally renders the results results

NG Client uses the Angular (v1) framework for helping to construct everything client-side. There are a LOT of other frameworks but a couple of years ago Angular caught on in a big way and pulled somewhat ahead of the pack. Today the scene has normalized quite a bit and with ES6 and ES7 there are a host of others incoming. All of which are more powerful and easier to use than the last.

The new thing with NG Client is how the browser is sending and receiving data from the browser after the initial load of a page. Instead of REST/AJAX/Polling it is using web sockets. Servoy is using this to "data broadcast" between all clients very efficiently. Browsers have had this for a while now and Servoy has now implemented this on their server.

Realtime web with any JDBC database with Servoy foundsets. This__is__a__big__deal.

3. Apples and oranges

There is a "combo" approach to delivering web apps and that is by delivering an apple when a page first loads and then switching over to being an orange for all interaction thereafter. The idea here is that a pre-rendered html page (with initial data) is faster to load up. This approach was made famous by Twitter (~2010?).

Recently, client-side frameworks come with the ability to run server-side as well (typically with Node server). This allows server pre-rendering at the component level using the same code written for the client. So for example, when you switch to a tab panel that has a grid of records — a pre-rendered view of records is presented initially (no multiple trips to the server, no code run client-side == very fast) and then as you scroll, websockets + client-side framework code takes over to load additional data into the grid.

But I digress...

1. Velocity has its place but it is only one tool in a power user's toolbox. In Sutra CMS, we use Velocity to produce the reports that we deliver to the web client even though we use JSP and Servoy headless client for the web server tasks. Velocity is a great mix-and-match tech and does some neat stuff server-side that would be a royal PITA otherwise. (Back in Smart Client days, Velocity was a life saver.)

2. I'm not arguing against the east-of-use approach Servoy is taking for NG Client. I'm just saying NG Client has a lot of limitations — the kind of limitations an equivalent to Velocity would solve. My argument then is that Servoy should make their session/websocket/foundset piece a discrete API that can be use to put realtime data in any web application using any front-end tech.

And with your front-end tech of choice, Velocity doesn't go away either: it gets used for pre-rendering and other template-based server-side tasks (we use server-side templating all over the place).

This does not take anything away from NG Client. If NG Client is all you need, perfect.

Next post all is solved....
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Servoy 8.0.0 beta 1

Postby david » Mon Apr 20, 2015 3:48 am

Back to the idea of making the session/websocket/foundset piece a discrete API so can plug Servoy's realtime web in any type of web app.

Servoy's code for this piece is here: https://github.com/Servoy/sablo. No license listed.

It turns out that the core functionality is implemented agnostic to any client-side framework and NG Client just consumes the functionality with some not-so-elegant client-side code. It gets the job done but some API-esque wiring would help clean up this code.

A weekend of poking and prodding later....

Basic mechanics

Server-side Servoy forms function to set up a model/foundset. Form has a datasource, the fields you put on the form are the allowable data fields the client can see.

Form items provide additional meta information to the client such as data formatters, calculations, i18n keys, tagging, UI parameters, etc.

Forms also provide services such as when a button is pushed, code on the server is run and a response is sent to the client. Foundset functions are automatically mirrored on the client. So something as simple as foundset.setSelectedIndex(foundset.getSelectedIndex() + 1); automatically returns the data for the next record for the fields you have on the form without you having to return the record yourself.

When an NG Client connects, a session is created and (all?) forms in your app have a state per session. Data broadcasting happens between sessions where the foundsets share the same visible foundset index(es). I assume all CRUD operations but edit is the only one I've tested so far.

All of this communication goes back and forth from clients and server via websockets as JSON. If a field is edited, only the data for that field is sent over the wire, not the whole record. Quite compact for most operations from what I've seen (initial connection response sends a lot of unnecessary Angular stuff is one exception).

websockets.png
websockets.png (132.5 KiB) Viewed 10527 times


Solution

Figured out the basic wiring to establish websocket connections, send messages to the server, and receive server responses. Servoy's JSON objects are consistent and easy to grok so mapping to client-side models of any particular framework will be easy.

Triggering form methods is straight forward. My guess is that only public methods are exposed on the client but on my list to test.

If a solution requires login, websocket endpoints are not created until you login.

A neat trick is that you can return any JS object from a form method (serialization to JSON happens automatically) and the client websocket.onmessage handler picks it right up. So not only can you trigger foundset methods but you return your own data structures over the pipe. (Note to self, test sending arguments to form methods.)

So there you have it — it is all possible to hook into Servoy's realtime web special sauce without having to go through NG Client.

And yes, we are available for hire!

Cheers - David

servoy_socket_test.png
servoy_socket_test.png (43.58 KiB) Viewed 10527 times
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Servoy 8.0.0 beta 1

Postby jcompagner » Mon Apr 20, 2015 5:19 pm

juan.cristobo wrote:Are you planning to include sample webcomponents and sample NG solutions in the installer?


we already are shipping this, but thats inside our plugins, the problem is a bit how to do it other wise?
Because that would just mean that you have to do some import on the workspace that you already had or just newly create.

as an example this is a basic set of components that we made using bootstrap: https://github.com/Servoy/servoy-client ... components
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 8.0.0 beta 1

Postby jcompagner » Mon Apr 20, 2015 5:44 pm

david wrote:
Servoy's code for this piece is here: https://github.com/Servoy/sablo. No license listed.



thats why we made this, thats for ngclient the "wicket" part
so that it is just a standalone thing that makes sure that the code is kept clean.

david wrote:It turns out that the core functionality is implemented agnostic to any client-side framework and NG Client just consumes the functionality with some not-so-elegant client-side code. It gets the job done but some API-esque wiring would help clean up this code.



which code is not so elegant!? ;)

david wrote:
Server-side Servoy forms function to set up a model/foundset. Form has a datasource, the fields you put on the form are the allowable data fields the client can see.

Form items provide additional meta information to the client such as data formatters, calculations, i18n keys, tagging, UI parameters, etc.



yes this is kind of just like wicket in the webclient, the ui component now really lives on the client so we need to push all the properties to the client so that we configure it like the webclient
So how the ui behaves,formats is now all done on the client.
For our default component set this is quite a bit of work, because we want to be as good backwards compatible as possible. But a clean new set of components are way simpler then our default component set
(only the properties like foreground,background and so on can be all gone by just 2 properties "style" and "class")

david wrote:Forms also provide services such as when a button is pushed, code on the server is run and a response is sent to the client.


its not really forms, and services is a bit wrong, what you are saying we call handlers (services are singletons most of the time, our plugin that we make to map on the default servoy plugins like window or dialog those are services)
But a handler that is defined in the spec (like onaction) is configures by the serverside so that a client side can just call it "handlers.onaction()" then the attached servoy script on the server side is being executed.

david wrote:When an NG Client connects, a session is created and (all?) forms in your app have a state per session. Data broadcasting happens between sessions where the foundsets share the same visible foundset index(es). I assume all CRUD operations but edit is the only one I've tested so far.


only the forms that are touched are created, the forms are way lighter then in the webclient/wicket. because they are basically just maps of webcomponents and a webcomponent is basically a map of property values.
(because all the ui things are really on the client, the server doesn't have any differences between a textfield and a combobox, both are just the same class/object instance (which is a map of values))

the thing is that you talk constantly just about foundset, but foundsets are not the only source of data, also globals or formvariables could be the data for the client side (or even just plain datasets if you want)
Also you seem to be saying i want the foundset as the thing that i want to have on the client, (as a proxy). But for servoy this is not the thing that we really talk to, servoy talks to forms and that has or can have a founset
but it is not directly just a plain foundset where you just talk to without having any form.


david wrote:All of this communication goes back and forth from clients and server via websockets as JSON. If a field is edited, only the data for that field is sent over the wire, not the whole record. Quite compact for most operations from what I've seen (initial connection response sends a lot of unnecessary Angular stuff is one exception).


which initial stuff are you really talking about? yes there is some initial request like getting the locale and timezone information from the browser, also a form is fully loaded (requestInitialData) and things like onshow of the form must also be taken care of (because the ui decides if a form is shown so it must tell us that)
Many services need to be instantiated.

david wrote:If a solution requires login, websocket endpoints are not created until you login.


thats not true, the websocket will be created directly, because the login could be a login form or login solution..
That state is only there when we create the client and load the solution that is requested.

david wrote:
A neat trick is that you can return any JS object from a form method (serialization to JSON happens automatically) and the client websocket.onmessage handler picks it right up. So not only can you trigger foundset methods but you return your own data structures over the pipe. (Note to self, test sending arguments to form methods.)



i do wonder if that works directly out of the box currently
because i think you are talking about client to server communication right?
so the handler of a button like "onaction" event

i am not sure if we really do that currently and what we return, because if you do in client side code:

var x = $scope.handlers.someactionreturnssomethingfromtheserver();

that then x is not directly the value that you return, because thats impossible everything is async, i guess we can return something (if we don't already) but that is the an promise ($q api)
where you need to register a method on in the then(xxx) function.

the other way already works like this, so server to client calls, like elements.textfield.getSelectedText()

that really does a directly call over the websocket to the actual ui component and ask for the selected text and that then is returned an the code on the server gets the value and moves on.
So the executing of that script really stops for a while so that the async call can execute completely

This is also why modal dialogs or plugins.dialog.showInput() now work again just like the smart client, scripting is just blocked and will move on when the result is there.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 8.0.0 beta 1

Postby david » Mon Apr 20, 2015 7:06 pm

Lot's of good info Johan, thanks.

If you are creating the endpoints on app initiation but before login, they are at least not accessible — which is a good thing for security purposes.

Form methods can and do return JSON when rolling your own websocket(s). Not sure if this is a side effect of your implementation but it is quite handy. I did make a note to test if it was async or not on the server. If not, need to see if can connect up headless client plugin functionality to websocket traffic. Of course the client is non-blocking and the responses can be queued up and handled in any fashion.

With a form acting as the server-side proxy, it's just a matter of observing the websocket traffic you are generating to eventually build a full picture of what is happening. This we can use to build our own client-side API.

Regarding cleanup: referring to servoy_app.js > sablo_app.js > websocket.js.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Servoy 8.0.0 beta 1

Postby juan.cristobo » Tue Apr 21, 2015 9:11 am

jcompagner wrote:as an example this is a basic set of components that we made using bootstrap: https://github.com/Servoy/servoy-client ... components


Interesting!!
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 186
Joined: Thu Apr 19, 2012 9:12 am

Previous

Return to Latest Releases

Who is online

Users browsing this forum: rafig and 14 guests