Storing input parameters

Posted by Jens Dahlin on 09-Apr-2015 08:19

Need some input and/or good ideas.  

I've got an appserver program that returns our products in a large number of ways depending on input.  It's got something like 25 differnt input parameters, CHARS, DATES and INTEGERS. 

This program is called from a web front that collect various data from the user and then renders a view of our products. Works like a charm!

Roughly what I've got:

RUN returnProducts.p ON ghServer 
( INPUT productTypes , INPUT fromPrice , INPUT toPrice , INPUT fromGrade , INPUT toGrade , INPUT parameter1 , INPUT parameter2 , INPUT parameterN , INPUT sortingOption , INPUT pageToShow , INPUT resultsPerPage , OUTPUT ttFilteredProducts).

Now I want to specify certain fixed parameter settings to use at various points, for instance for background jobs generating xml-feeds with our products as well as webpages returning specific products on sale. Something like 50-100 different such settings will exists. The final goal is for our sale managers to be able to set up these parameters themselves and then make that collection of products into a webpage, xml-feed, rss-feed etc.

What I need is a table in which to store all parameter settings together with some metadata. I can see some options here:

1) Store parameters in a table with one field for each input parameter. Positive: easy to do. Negative: changing parameters will lead to schema changes.

2) Store all parameters in a single character field with some kind of delimiter. For instance first entry in a pipe delimited value is the first parameter, second entry is second parameter etc. Positive: easy and flexible schema . Negative:  harder to maintain, require a more complicated UI to make sure data types are correct etc. 

3) Rewrite the server-side program to take a value-pair TEMP-TABLE (ie tt.parameterName + tt.parameterValue) as input instead. Positive: easy to translate into a matching db table and flexible. Negative: lots of work to redo server-side program as well as existing UI.

Oh, and not OO!

Any better ideas? 

All Replies

Posted by Peter Judge on 09-Apr-2015 08:31

Other ideas – not sure if better.
 
A question: what are you planning on storing? Both the metadata (ie "returnProducts" has these N parameters) and arguments (this particular call is for "returnProducts" and the N parameters have M values)?

1) Store parameters in a table with one field for each input parameter. Positive: easy to do. Negative: changing parameters will lead to schema changes.

For storing the meta-data, a variant of this:
A table for the call (ie name = returnProducts)
                Field CallName
You can also add other stuff like access control and visibility (public, public-to-abl, public-to-web etc)
 
And then a table for the arguments
                Field parentCall
                Field paramOrder
                Field paramName
                Field paramType (CHAR, INT, ...)
                Field paramIOMode (IN, OUT, IN-OUT, ...
No schema changes when you add new calls.
 
For runtime, a variant of 3):

3) Rewrite the server-side program to take a value-pair TEMP-TABLE (ie tt.parameterName + tt.parameterValue) as input instead. Positive: easy to translate into a matching db table and flexible. Negative: lots of work to redo server-side program as well as existing UI.

4) Rewrite server to take a JSON argument. Pros: very flexible in the structure of the filter/argument; JSON is native to the web (so no translations to/from a TT. Cons: rewrite server code. But I suspect you have to do that anyway (although you could wrap the existing procedures around the new JSON-based procedure too)
 
 
 
[collapse]
From: Jens Dahlin [mailto:bounce-Jensairtoursse@community.progress.com]
Sent: Thursday, 09 April, 2015 09:20
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] Storing input parameters
 
Thread created by Jens Dahlin

Need some input and/or good ideas.  

I've got an appserver program that returns our products in a large number of ways depending on input.  It's got something like 25 differnt input parameters, CHARS, DATES and INTEGERS. 

This program is called from a web front that collect various data from the user and then renders a view of our products. Works like a charm!

Rougly:

RUN returnProducts.p ON ghServer 
                    ( INPUT productTypes
                    , INPUT fromPrice
                    , INPUT toPrice
                    , INPUT fromGrade
                    , INPUT toGrade
                    , INPUT parameter1
                    , INPUT parameter2
                    , INPUT parameterN
                    , INPUT sortingOption
                    , INPUT pageToShow
                    , INPUT resultsPerPage
                    , OUTPUT ttFilteredProducts).
                    

Now I want to specify certain fixed parameter settings to use at various points, for instance for background jobs generating xml-feeds with our products as well as webpages returning specific products on sale. Something like 50-100 different such settings will exists. The final goal is for our sale managers to be able to set up these parameters themselves and then make that collection of products into a webpage, xml-feed, rss-feed etc.

What I need is a table in which to store all parameter settings together with some metadata. I can see some options here:

1) Store parameters in a table with one field for each input parameter. Positive: easy to do. Negative: changing parameters will lead to schema changes.

2) Store all parameters in a single character field with some kind of delimiter. For instance first entry in a pipe delimited value is the first parameter, second entry is second parameter etc. Positive: easy and flexible schema . Negative:  harder to maintain, require a more complicated UI to make sure data types are correct etc. 

3) Rewrite the server-side program to take a value-pair TEMP-TABLE (ie tt.parameterName + tt.parameterValue) as input instead. Positive: easy to translate into a matching db table and flexible. Negative: lots of work to redo server-side program as well as existing UI.

Any better ideas? 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Jens Dahlin on 09-Apr-2015 08:40

Thanks!

Actual values is basically all I need. Metadata would be a bonus but I think both your ideas are good. This will require some thinking...

Posted by Matt Baker on 09-Apr-2015 11:37

What version of OpenEdge?  It matters.
 
Please don’t use single fields to pass multiple values.  Someone is going to want to use your delimiter in a value.  You’re also going to have to use positional based arguments which I’ll guarantee will eventually come back to bite you in the future when someone decides to re-use one of the fields. 
 
Send a pair of arrays one with field name, one with field value, or a temp-table with nam-value pairs as  you suggest (in lieu of the ABL supporting proper Dictionary objects), or if you prefer OO, then pass an object which you can then extend with new fields as needed..
 
Doing this in java or some other OO language, I would wrap this into a single object and pass that single object instead.  Martin in Clean Code (pg 43) argues that having more than 2- 3 parameters to a function is wrong.  The fix is to use a “parameter class” which encapsulates the data you need to pass, and then simply pass an instance of that one object.
 
I ask what openedge version, because in recent version you can pass objects across appserver boundary.
 
mattB
 
[collapse]
From: Jens Dahlin [mailto:bounce-Jensairtoursse@community.progress.com]
Sent: Thursday, April 09, 2015 9:20 AM
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] Storing input parameters
 
Thread created by Jens Dahlin

Need some input and/or good ideas.  

I've got an appserver program that returns our products in a large number of ways depending on input.  It's got something like 25 differnt input parameters, CHARS, DATES and INTEGERS. 

This program is called from a web front that collect various data from the user and then renders a view of our products. Works like a charm!

Rougly:

RUN returnProducts.p ON ghServer 
                    ( INPUT productTypes
                    , INPUT fromPrice
                    , INPUT toPrice
                    , INPUT fromGrade
                    , INPUT toGrade
                    , INPUT parameter1
                    , INPUT parameter2
                    , INPUT parameterN
                    , INPUT sortingOption
                    , INPUT pageToShow
                    , INPUT resultsPerPage
                    , OUTPUT ttFilteredProducts).
                    

Now I want to specify certain fixed parameter settings to use at various points, for instance for background jobs generating xml-feeds with our products as well as webpages returning specific products on sale. Something like 50-100 different such settings will exists. The final goal is for our sale managers to be able to set up these parameters themselves and then make that collection of products into a webpage, xml-feed, rss-feed etc.

What I need is a table in which to store all parameter settings together with some metadata. I can see some options here:

1) Store parameters in a table with one field for each input parameter. Positive: easy to do. Negative: changing parameters will lead to schema changes.

2) Store all parameters in a single character field with some kind of delimiter. For instance first entry in a pipe delimited value is the first parameter, second entry is second parameter etc. Positive: easy and flexible schema . Negative:  harder to maintain, require a more complicated UI to make sure data types are correct etc. 

3) Rewrite the server-side program to take a value-pair TEMP-TABLE (ie tt.parameterName + tt.parameterValue) as input instead. Positive: easy to translate into a matching db table and flexible. Negative: lots of work to redo server-side program as well as existing UI.

Any better ideas? 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Thomas Mercer-Hursh on 09-Apr-2015 11:43

And, if you want to make the solution technology neutral, consider passing JSON equivalent to the temp-table instead of the temp-table itself since then any kind of client can submit a request.

Posted by Matt Baker on 09-Apr-2015 11:59

 
Be careful not to mix “transport” concepts with “message encoding” concepts.  Using JSON as a message encoding is nice with working with HTTP.  But for appserver it isn’t a good thing.  Using JSON on the wire should be handled as the mapping layer on the edge of your application boundary (in your case into the appserver, and out of the appserver).  This is what REST Adapter (oe web server) is for.  It takes care of the message encoding, and tomcat deals with the transport (HTTP).
 
Passing “raw” JSON inside a memptr or  longchar through a straight appserver call means your application is no longer transport or encoding neutral.  What you would end up with is taking care of both the encoding and the transport inside your application.  And then you are still stuck with an appserver run statement.
 
 
From an application stand point use the encoding that makes your application maintainable.  But of course, also consider future encodings.  Sending raw JSON in a longchar means you have to either map that JSON back to objects or temp-tables on BOTH ends, or you have to write the code that consumes it to work purely with JSON on BOTH ends (client and appserver). 
 
ABL doesn’t have good reflection or annotation support so you building a flexible framework to make this consumption easy isn’t possible yet. In java world we have libraries like Jackson and Jax-RS that handle this.  ABL isn’t there yet.
 
Please don’t use JSON as message encoding format for appserver unless you are using REST adapter.  It isn’t appropriate.  If you are going to REST adapter in the future, consider using a data type that can be consumed by the REST adapter.  OOABL cannot be right now, but temp-tables and arrays can be.
 
 
[collapse]
From: Thomas Mercer-Hursh [mailto:bounce-tamhas@community.progress.com]
Sent: Thursday, April 09, 2015 12:45 PM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] Storing input parameters
 
Reply by Thomas Mercer-Hursh

And, if you want to make the solution technology neutral, consider passing JSON equivalent to the temp-table instead of the temp-table itself since then any kind of client can submit a request.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Thomas Mercer-Hursh on 09-Apr-2015 12:06

Well, Matt, I would question a couple of points.  It is fine to deal with things as a TT on the AppServer and, at the last minute, use WRITE-JSON to provide a parameter to pass.   Likewise, at the ABL client end, a single READ-JSON should turn that back into a TT so there is no need to write JSON handling code at either end.   And, a number of the possible consuming clients are not REST, but rather Java, .NET, or Web clients calling to the AppServer.

Posted by Mike Fechner on 09-Apr-2015 12:10

Thomas, which client that can communicate with the AppServer can't handle Temp-Table parameters?

- Progress Client, check
- .NET Client, check
- Java Client, check
- SOAP Client, check
- Java Client, Check

Did I miss one?

Jens question was about storing parameters for later redo.

What I dislike about name/value temp-tables is they are not strong typing the method call.

A specific temp-table is strong typed but can have 0, 1 or many parameters. And you can't enforce that on the methods signature.

So I would build my own concept of serializable objects. Pick XML, Json or whatever format you like. That allows you to store them in DB or flat file and also pass them from those clients that do not support the native object serialization of 11.4

My preference was JSON as the format.

Von meinem Windows Phone gesendet

Von: Thomas Mercer-Hursh
Gesendet: ‎09.‎04.‎2015 18:44
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Storing input parameters

Reply by Thomas Mercer-Hursh

And, if you want to make the solution technology neutral, consider passing JSON equivalent to the temp-table instead of the temp-table itself since then any kind of client can submit a request.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Matt Baker on 09-Apr-2015 12:21

In ABL you don't know the serialization format for temp-tables.  You don't care.  It just works as the run statement takes care of it for you.  The RUN statement in this case is your boundary.  

As Mike points out, the open clients, ABL clients, appserver, and REST adapter all deal with it with varying degrees of transparency.  So from the ABL application developer perspective the message encoding is a black box and you don't worry deal with it.

I also agree with his point about strong typing.  You lose that when you use name-value pairs.  BUT...

When straight ABL (ignoring open clients and rest adapter for the moment) you cannot do this with objects.  11.5 introduced ABL object serialization across appserver boundary, but support wasn't added for the open clients and rest adapter, files and so on.  So the serialization format isn't technology neutral yet, your application has to deal with it.  I speculate that eventually this will be addressed.

If you pick JSON and bundle it into a longchar variable you've chosen your message encoding  at the application layer instead of at the transport layer.  You can no longer change it.  You want XML?  That's a new parameter to request XML. Ignore the "efficiency" arguments for the moment.  You still haven't transported it yet, you have merely changed the encoding from say "object" to "string".

So for future proof you need a technology (read: transport) neutral solution that doesn't burn the message encoding into the application layer, allows easy additions of new name-value pairs so API signatures don't have to change (read: the .p running on the appserver), and allows for new future encodings.

The choice is based on the technologies and future technologies in play.  If you'll never use open client, and always use OOABL (for the moment), then objects are a first place choice.  Or you can bet in the future that additional OOABL serialization options become available to support those other transports.  If you are using/going open client, or REST adapter, then and you need it now, then this isn't a good choice.

Posted by Mike Fechner on 09-Apr-2015 12:30

I agree with all your point s, Matt!

But all relevant client technologies today either work well with JSON or XML... Our deserialization routine checks the first char to know if the one parameter object was passed as XML or JSON. So I can pass XML Serializable from .NET or JSON from Java Script through JSDO. And I also feel future proof as there is only a small set of code that deals with Serialization and Deserialization. When a new format become en vougue I trust I can incorporate that without impacting any application code.

Von meinem Windows Phone gesendet

Von: Matt Baker
Gesendet: ‎09.‎04.‎2015 19:22
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Storing input parameters

Reply by Matt Baker

In ABL you don't know the serialization format for temp-tables.  You don't care.  It just works as the run statement takes care of it for you.  The RUN statement in this case is your boundary.  

As Mike points out, the open clients, ABL clients, appserver, and REST adapter all deal with it with varying degrees of transparency.  So from the ABL application developer perspective the message encoding is a black box and you don't worry deal with it.

I also agree with his point about strong typing.  You lose that when you use name-value pairs.  BUT...

When straight ABL (ignoring open clients and rest adapter for the moment) you cannot do this with objects.  11.5 introduced ABL object serialization across appserver boundary, but support wasn't added for the open clients and rest adapter, files and so on.  So the serialization format isn't technology neutral yet, your application has to deal with it.  I speculate that eventually this will be addressed.

If you pick JSON and bundle it into a longchar variable you've chosen your message encoding  at the application layer instead of at the transport layer.  You can no longer change it.  You want XML?  That's a new parameter to request XML. Ignore the "efficiency" arguments for the moment.  You still haven't transported it yet, you have merely changed the encoding from say "object" to "string".

So for future proof you need a technology (read: transport) neutral solution that doesn't burn the message encoding into the application layer, allows easy additions of new name-value pairs so API signatures don't have to change (read: the .p running on the appserver), and allows for new future encodings.

The choice is based on the technologies and future technologies in play.  If you'll never use open client, and always use OOABL (for the moment), then objects are a first place choice.  Or you can bet in the future that additional OOABL serialization options become available to support those other transports.  If you are using/going open client, or REST adapter, then and you need it now, then this isn't a good choice.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Thomas Mercer-Hursh on 09-Apr-2015 13:14

What I dislike about passing TT's across the AppServer boundary is the coupling it creates between subsystems.  A TT is a very specific implementation.  The JSON corresponding to that implementation is just a message ... a message which seems to be understood by all current technologies in a native way.  Put the translation in an interface layer, if you wish.

Posted by Mike Fechner on 09-Apr-2015 13:27

Why can’t you create decoupled systems using temp-tables? Why is a TT a very specific implementation and a JSON string not? Why can’t a temp-table not be just a message?

Gesendet von Windows Mail

Von: Thomas Mercer-Hursh
Gesendet: ‎Donnerstag‎, ‎9‎. ‎April‎ ‎2015 ‎20‎:‎15
An: TU.OE.Development@community.progress.com

Reply by Thomas Mercer-Hursh

What I dislike about passing TT's across the AppServer boundary is the coupling it creates between subsystems.  A TT is a very specific implementation.  The JSON corresponding to that implementation is just a message ... a message which seems to be understood by all current technologies in a native way.  Put the translation in an interface layer, if you wish.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Thomas Mercer-Hursh on 09-Apr-2015 13:34

Because a TT is a very specific ABL implementation whose definition has to be shared by both ends of the communication.  A JSON string is just a string.

Posted by Mike Fechner on 09-Apr-2015 13:36

But a JSON string without agreement on the content/structure is pointless.
 
Temp-Tables can also be passed dynamically. With random schema.
 
I don’t get your point!

Posted by Thomas Mercer-Hursh on 09-Apr-2015 13:46

Naturally, both ends have to agree on message format or meaning or the message would make no sense.  The point is that a JSON string is physically just a string and the interpretation of that string makes no assumption about technology, structures, anything.  Whereas, a TT is a very specific ABL implementation artifact which has to be translated into a very specific implementation artifact in the target language.  That is strong coupling at the level of implementation.

Posted by Mike Fechner on 09-Apr-2015 13:49

And – I repeat my questions from an earlier response  - which target system that can communicate with the AppServer has a problem with Temp-Tables?

Posted by Thomas Mercer-Hursh on 09-Apr-2015 13:53

That it works is not the point.  If the only possible client was an ABL client, I would still object because of the need to have matching TT definitions.  The TT definition in an include file thing is a giveaway to me of implementation coupling.

Posted by Mike Fechner on 09-Apr-2015 13:56

Now you object yourself… Matching TT definitions is tight coupling. But agreeing on JSON content is not. And you don’t even comment on my remark about the dynamic temp-tables.

 

Posted by ChUIMonster on 09-Apr-2015 14:03

On 4/9/15 2:46 PM, Thomas Mercer-Hursh wrote:

The point is that a JSON string is physically just a string and the interpretation of that string makes no assumption about technology, structures, anything.


JSON makes lots of assumptions.  You can't throw just any old bunch of gibberish at it.  And the two endpoints have to agree about lots of stuff for it to be at all useful.

-- 
Tom Bascom
603 396 4886
tom@greenfieldtech.com

Posted by Marian Edu on 09-Apr-2015 14:11

Interesting idea Thomas, does this mean you just don't pass temp tables datasets to appsrv even when connecting from abl client and prefer instead to send data serialized as JSON?

Posted by Thomas Mercer-Hursh on 09-Apr-2015 14:18

The distinction is that a TT is an ABL-specific implementation.  JSON is a standard message format understood by a wide range of technologies.  A TT is not just data, but data and behavior.  A JSON string is just data.  That sender and receiver have to agree on the meaning of the message is tautological.   But, for example, a receiver can choose to pluck out a single data item from the message and pay attention only to that, but it has to have an entire counterpart to the TT.

@Marian ... it has been a long time since I wrote any client code or even application code, so the issue hasn't arisen, but I would certainly be thinking in those terms, yes.

Posted by Mike Fechner on 09-Apr-2015 14:26

I don’t get that!
 
There are differences between JSON and TT’s. I use both – based no which fits best.
 
But your argumentation simply does not make any sense to me.

Posted by Thomas Mercer-Hursh on 09-Apr-2015 14:34

You don't see the difference between an ABL-specific implementation that has behavior like indexes and the like and a simple string written in a language independent format?

Posted by Mike Fechner on 09-Apr-2015 14:37

Not with any practical relevance!

Indexes are optional on temp-tables.

Posted by ChUIMonster on 09-Apr-2015 14:44

It's all about fit to purpose.

If I've got an ordered set of data a temp-table with appropriate indexes is a pretty darned good fit.

Even if it isn't ordered -- a set of repeating rows is very good fit with a TT.

JSON is obviously a better fit for "one off" or "every message is different" kinds of applications.

JSON is not such an obviously good fit for table-like purposes.

Kind of like Mongo is a good database for not very structured data -- but you probably don't want to use it for your payroll system.


RE: Storing input parameters

Reply by Thomas Mercer-Hursh

You don't see the difference between an ABL-specific implementation that has behavior like indexes and the like and a simple string written in a language independent format?

Stop receiving emails on this subject.

Flag this post as spam/abuse.



-- 
Tom Bascom
603 396 4886
tom@greenfieldtech.com

Posted by Thomas Mercer-Hursh on 09-Apr-2015 14:45

TT have an default index even if one doesn't define one.  The data types are ABL specific.  They are just miles away from a technology independent message.  The only reason they work as parameters with non-ABL clients is because PSC has chosen to implement a map from the ABL specific implementation to an implementation specific to the other language.

Posted by Peter Judge on 09-Apr-2015 14:48

One big benefit of JSON is that just about anyone talks it (similar to XML). That benefit outweighs its weak-typeness, most of the time.
 
-- peter
 
[collapse]
From: ChUIMonster [mailto:bounce-ChUIMonster@community.progress.com]
Sent: Thursday, 09 April, 2015 15:46
To: TU.OE.Development@community.progress.com
Subject: Re: [Technical Users - OE Development] Storing input parameters
 
Reply by ChUIMonster
It's all about fit to purpose.

If I've got an ordered set of data a temp-table with appropriate indexes is a pretty darned good fit.

Even if it isn't ordered -- a set of repeating rows is very good fit with a TT.

JSON is obviously a better fit for "one off" or "every message is different" kinds of applications.

JSON is not such an obviously good fit for table-like purposes.

Kind of like Mongo is a good database for not very structured data -- but you probably don't want to use it for your payroll system.


RE: Storing input parameters
Reply by Thomas Mercer-Hursh

You don't see the difference between an ABL-specific implementation that has behavior like indexes and the like and a simple string written in a language independent format?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

 
-- 
Tom Bascom
603 396 4886
tom@greenfieldtech.com
Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Mike Fechner on 09-Apr-2015 14:54

And that map as you call it is part of the only paths to the AppServer...
 
Why not use it as efficient as possible? Why tie at least one arm behind your back? When you can’t get into the AppServer other than through the “map” that Progress provides? Don’t you trust them that they’d implement Temp-Tables and ProDatasets as first class citizens when they’d add additional transports to the AppServer in the future? They have a very good proven track record here.
 
JSON data types also require a map on most systems.
 
It may not be relevant in your part of the world. But check the Progress K-Base for the various challenges with JSON and numeric and date formats… I rather let Progress handle the conversion in the various OpenClients including Java, .NET and SOAP and REST.
 
I prefer to build systems that work. And are future proof.

 

Posted by Mike Fechner on 09-Apr-2015 14:59

So Peter, when the ABL expects Temp-Table data … and the client is Java or .NET
 
Would you build a JSON string, that hopefully matches the demanded format.
 
Or would you use the mapping to temp-tables that Progress has built into the Open Clients?
 
For a REST client temp-tables will be passed into JSON by the REST adapter. Why should I do that on the ABL side and pass a LONGCHAR to the outside world?

 

Posted by Mike Fechner on 09-Apr-2015 15:01

A single .p can return ANY temp-table to native .NET data table, a Java set, JSON and XML. Whatever works best for the client in question. That’s so damn cool. I don’t force people to deal with JSON if they rather wouldn’t.
Von: Peter Judge [mailto:bounce-pjudge@community.progress.com]
Gesendet: Donnerstag, 9. April 2015 21:50
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Storing input parameters
 
Reply by Peter Judge
One big benefit of JSON is that just about anyone talks it (similar to XML). That benefit outweighs its weak-typeness, most of the time.
 
-- peter
 
[collapse]
From: ChUIMonster [mailto:bounce-ChUIMonster@community.progress.com]
Sent: Thursday, 09 April, 2015 15:46
To: TU.OE.Development@community.progress.com
Subject: Re: [Technical Users - OE Development] Storing input parameters
 
Reply by ChUIMonster
It's all about fit to purpose.

If I've got an ordered set of data a temp-table with appropriate indexes is a pretty darned good fit.

Even if it isn't ordered -- a set of repeating rows is very good fit with a TT.

JSON is obviously a better fit for "one off" or "every message is different" kinds of applications.

JSON is not such an obviously good fit for table-like purposes.

Kind of like Mongo is a good database for not very structured data -- but you probably don't want to use it for your payroll system.


RE: Storing input parameters
Reply by Thomas Mercer-Hursh

You don't see the difference between an ABL-specific implementation that has behavior like indexes and the like and a simple string written in a language independent format?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

 
-- 
Tom Bascom
603 396 4886
tom@greenfieldtech.com
Stop receiving emails on this subject.

Flag this post as spam/abuse.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by ChUIMonster on 09-Apr-2015 15:03

If I'm talking to the outside world sure.  If I'm talking to OE?  Don't be silly.

It's still awfully wordy.  Not as bad as XML but bad enough.

If the OE database stored JSON in an indexable and queryable manner that would be really cool.  Stuffing it into a CLOB where you cannot do much of anything useful with it is just silly.


RE: Storing input parameters

Reply by Peter Judge
One big benefit of JSON is that just about anyone talks it (similar to XML). That benefit outweighs its weak-typeness, most of the time.


-- 
Tom Bascom
603 396 4886
tom@greenfieldtech.com

Posted by Thomas Mercer-Hursh on 09-Apr-2015 15:18

Wordy?  Have you compared the data packet size of a TT vs the corresponding JSON?

Posted by ChUIMonster on 09-Apr-2015 15:31

Have you?   Didn't you mention above that you don't write any code?

Getting the size of the JSON is easy enough -- I'd be kind of curious how one might determine the TT size.



RE: Storing input parameters

Reply by Thomas Mercer-Hursh

Wordy?  Have you compared the data packet size of a TT vs the corresponding JSON?



-- 
Tom Bascom
603 396 4886
tom@greenfieldtech.com

Posted by Thomas Mercer-Hursh on 09-Apr-2015 15:44

That's why one would have to look at the actual packet.   I am remembering Greg's experiments way back when when he discovered that he could convert to XML and send that and put it back in a TT faster than he could send the TT.  That was before the options to not send schema and stuff, but it still makes me wonder.

Posted by Thomas Mercer-Hursh on 09-Apr-2015 15:45

Oh, and I said little "client" code, that doesn't mean no code.

Posted by Mike Fechner on 09-Apr-2015 15:50

With the amount of noise you make about banning the use of the most natural data format, I would have expected you have a data point. Sorry that I was wrong with that assumption.
Because we expose ProDatasets in their natural form, integrating our OERA backend with Rollbase, OpenEdge BPM, OpenEdge Mobile, Kendo UI, .NET and Java and … (I am sure I missed a few) was a piece of cake.
 
For me that’s a real world advantage.
 
Von: Thomas Mercer-Hursh [mailto:bounce-tamhas@community.progress.com]
Gesendet: Donnerstag, 9. April 2015 22:45
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Storing input parameters
 
Reply by Thomas Mercer-Hursh

That's why one would have to look at the actual packet.   I am remembering Greg's experiments way back when when he discovered that he could convert to XML and send that and put it back in a TT faster than he could send the TT.  That was before the options to not send schema and stuff, but it still makes me wonder.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by ChUIMonster on 09-Apr-2015 16:27

I don't have a quick and easy way to take a peek at the network packets
all deployed and ready to go with test code for this purpose. But I
expect that it is reasonable to think that they are not significantly
bigger than the in memory size of the TT.

I do just happen to have some code that turns a non-trivial ProDataSet
into JSON. And just for kicks and grins I added a little loop to add up
the buffer:record-length as it wanders through the dataset. That only
took a minute or two.

In this case the JSON is about 3x the size of the TT/PDS.

Probably mostly because the TT isn't repeating the field names over and
over and over and over with each record. There is other useless junk in
the JSON but the bulk of the wordiness is from repeating the field names
with each iteration of a record.

So, yes, JSON is "wordy" compared to a Progress TT.

Not as bad as XML though -- if I spit out XML it is usually at least 6x
or 8x the size of the TT/PDS (the field names get repeated *twice* per
record and there is lots more extra decoration thrown in).

Posted by Thomas Mercer-Hursh on 09-Apr-2015 16:36

I would expect the results to be highly dependent on the nature of the specific TT or PDS and for the wire version to be quite different than the in-core version.

Posted by Mike Fechner on 09-Apr-2015 16:42

“I would expect the results to be highly dependent on the nature of the specific TT or PDS”
 
So you expect an application developer on a daily basis to think about those – hypothetic - dependencies?
Application developers need a single simple way that works.

 

Posted by Thomas Mercer-Hursh on 09-Apr-2015 16:57

No, I don't expect the developer to do it different ways.  I expect them to do it the same way every time.

Posted by Thomas Mercer-Hursh on 09-Apr-2015 17:00

In particular, if messages passed across subsystem boundaries are ABL dependent technology, then if you change the technology in one of the subsystems you will have to rework the interface.  If it isn't, you don't.  Perhaps the AppServer boundary in specific includes some magic that allows you to fake the relationship, but that assumes the communication will always be over an AppServer boundary.  What happens, for example, when you implement a messaging system to communicate to a remote system ... not AppServer, but some standard messaging protocol, e.g., if the remote system is not ABL.  Maybe its COBOL!  Then the JSON message will go over any protocol you choose and the TT won't.

Posted by Mike Fechner on 09-Apr-2015 17:07

And what if in COBOL there are cool libraries for XML or CVS. But JSON sucks? What then?
 
Deal with Temp-Tables and ProDataset as long as you can. Accept them. They don’t hurt.
 
If you need to talk to another system that does not speak temp-tables through sockets or JMS or morse code … switch to that format at the latest possible point. And avoid that as much as possible. If Progress offers to handle that through a built in adapter – use that. Period.

Posted by ChUIMonster on 09-Apr-2015 17:33

On 4/9/15 5:37 PM, Thomas Mercer-Hursh wrote:

I would expect the results to be highly dependent on the nature of the specific TT or PDS and for the wire version to be quite different than the in-core version.




Of course the gory details will vary.  But the general trend will not.  JSON is going to be very wordy compared to a TT.  And XML will be worse.

I took some time to setup a test of what goes on the wire when running between a Progress client and an app server.

In the good old sports2000 database the customer table is 165K when dumped to .d.  Adding up record-length( customer ) gets you 148K.

Passing it over the wire using a TT takes about 180K -- there was some extra housekeeping in that number from connecting to the app server session.

WRITE-JSON resulted in 370K
WRITE-XML is 492K

So in this case the JSON is twice the size of the TT and the XML is 3X.


Posted by Mike Fechner on 09-Apr-2015 17:38

Are you even aware that JSON has no standard for date formats at all? Passing dates to a foreign system via JSON is always Russian roulette. There is more that can go wrong than dmy and mdy.

There are even two competing specs about JSON.

And it is still your preferred format?

Von meinem Windows Phone gesendet

Von: Thomas Mercer-Hursh
Gesendet: ‎10.‎04.‎2015 00:01
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Storing input parameters

Reply by Thomas Mercer-Hursh

In particular, if messages passed across subsystem boundaries are ABL dependent technology, then if you change the technology in one of the subsystems you will have to rework the interface.  If it isn't, you don't.  Perhaps the AppServer boundary in specific includes some magic that allows you to fake the relationship, but that assumes the communication will always be over an AppServer boundary.  What happens, for example, when you implement a messaging system to communicate to a remote system ... not AppServer, but some standard messaging protocol, e.g., if the remote system is not ABL.  Maybe its COBOL!  Then the JSON message will go over any protocol you choose and the TT won't.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Marian Edu on 10-Apr-2015 00:03

That means if there will be a mean to pass the message in one's own language and the message is correctly delivered to the other end in their native language we should still stick to using English just because we don't want to be dependent on that transport technology?

If  I need a temp-table on abl, a result set on java or a dataset on .net then would rather use the opportunity to pass them across if possible as-is and don't care much how it's been done instead of writing my own serialization routine... I'm pretty sure Thomas you were requesting passing objects across appsrv boundaries and you'll probably agree tt's and datasets are still objects (you do mention those are more than data storage but have methods and hence functionality).

The data types are not abl specific, those gets translated just fine in java/.net equivalent while one can argue JSON is just using the JS data types... in fact it is what it is, a JS object notation.

Beside, as Mike said, the serialization (if needed) can be done by a very thin application component that is usually part of the framework so the developer doesn't need to care it's data structure will have to travel in any specific serialization format. The developer works with language specific data types, not every developer need to worry about how those gets serialized if a message need to be sent out or received into the system.  

Posted by Jens Dahlin on 10-Apr-2015 00:37

Thank you for ideas (and in depth discussion on pros/cons/philosophy of temp-tables vs json vs xml). I'm currently on 11.4 by the way...

Posted by Thomas Mercer-Hursh on 10-Apr-2015 09:20

Actually, Marian, I consider passing objects across the wire anathema.

This thread is closed