|
|
|
|
Re: Wizard for IBM i program calls [message #857001 is a reply to message #855584] |
Thu, 26 April 2012 06:44 |
Dan Darnell Messages: 145 Registered: November 2011 Location: Arkansas |
Senior Member |
|
|
Hi Ben.
I've been working through more examples and more complex examples...basically, revisiting my "EGL Has Landed" article from 2008 (http://www.iprodeveloper.com/article/rpg-programming/the-egl-has-landed-calling-rpg-programs-from-egl-62294).
I would love to see a wizard for annotation creation but I think maybe it is more of a marketing device than a practical one. Maybe I am in the minority but (with a few exceptions) when I have an example in code to draw from I tend to use the code rather than walking through a wizard to get to some code. I say "marketing device" because I think that a wizard shows really well and gives people who are new to the language that extra help needed to make it up the learning curve.
As for the discussion of proxy functions vs. interfaces...interesting reading. Granted, I'm still coming up to speed here but I like the proxy functions. I like being able to have a library (or service) consisting of functions that represent calls to different programs and/or functions in service programs. (Some of the implementation details discussed in the bugzilla entry are beyond me. For example, the notes on the bugzilla entry end this way "For now, here's the resolution: the proxy function will disappear in favor of an abstract function, but the overall structure is the same." I don't know what this means. Does it mean that we'll still be able to create functions with annotation in libraries, services, etc.?)
That said, I see the wisdom in the one-approach thinking. When I wrote about leveraging XMLService to make RPG program calls (see http://www.ibmsystemsmag.com/ibmi/developer/rpg/EGL-and-XMLService--Hand,-Meet-Glove/) the program calls came via an interface function. I just need to think about the whole topic a bit more and try to get my head around it.
Note too that there is mention in the bugzilla notes of an issue with credentials being static in the descriptor. We (almost) always make IBM i program calls as a "super user" and then use the switch profile function on the IBM i server to check user credentials. This ensures that the program call itself succeeds and allows us to gracefully respond to the client with authentication/authorization messages. So static credentials aren't necessarily just for use in a testing environment ... it just depends how authentication/authorization is implemented in a given application.
--Dan
|
|
|
Re: Wizard for IBM i program calls [message #857491 is a reply to message #857001] |
Thu, 26 April 2012 15:30 |
Ben Margolis Messages: 10 Registered: December 2011 |
Junior Member |
|
|
Dan,
Thanks for your response.
"Does [the use of an abstract function] mean that we'll still be able to create functions with annotation in libraries, services, etc.?).
Yes.
Since the EGL developer is not placing logic in the proxy function, it makes more sense to use a construct that looks like a function prototype (as now found in an Interface type) and to assign annotations to that prototype. Those constructs would be in a Library or Service, and no one would ever be tempted to add custom logic to an actual, concrete proxy function. Is a small change, a bit more elegant.
My suggestion (and Joe's) is to have the function prototypes be in an Interface type. Then we can explain the EGL back-end access technology in one short training session; or in an elevator speech or commercial. ("We" means all of us who want the technology to be simple and cool for an audience that should go way beyond the grizzled IT professional.) Given this change, your set of "functions" would be a set of function prototypes in one or more Interface types. Each prototype would be annotated: no change. However, call statements would be structured as they are structured for service access.
For service access (an asynchronous access, from Rich UI):
myBindingVar01 IHttp {@Resource {uri="binding:myJavaScriptDDEntry"}};
call MyInterface01.myServiceFunction("abc") using myBindingVar ... etc.
For IBM i access (a synchronous access, from a service generated to Java):
myBindingVar02 IBMiConnection {@Resource {uri="binding:myJavaDDEntry"}};
call MyInterface02.myIBMiFunction("abc") using myBindingVar02 ... etc.
The structure might not be exactly how people are used to thinking about accessing IBM i programs; but the uniformity of service and program access would be another reason to say, "Yes, learn a new language, it won't take you long, and even your junior developers can do sophisticated work quickly."
An aspect of life is that most people cannot remember more than a few rules at a time. We should be targeting simplicity, along with the ability to do work that is arbitrarily complex. Both of those are aspects of a language that could become surprisingly successful.
Your notes here suggest that you think that we've already made the sale for IBM i. Well, please consider this over the next couple of days. The folks at EGL Central tend to look to you (and to Joe Pluta) for a real-world sense about the IBM i usage.
If you agree with the bugzilla entry, you might help to change the direction for back-end access in general. If you don't agree with the entry, I'll likely close it.
[Updated on: Thu, 26 April 2012 21:21] Report message to a moderator
|
|
|
|
|
Re: Wizard for IBM i program calls [message #858036 is a reply to message #857786] |
Fri, 27 April 2012 01:21 |
Ben Margolis Messages: 10 Registered: December 2011 |
Junior Member |
|
|
Two variations are available if you want to access an IBM i program from a Rich UI app:
o The Rich UI app can access a proxy function that resides in a service. In this case, the proxy function calls the back-end IBM i function synchronously and returns a message to the Rich UI application. However, the Rich UI app must rely on the details that are in the IBMiProgram annotation, which must include all details necessary to establish a connection with the program on IBM i.
o Alternatively, the Rich UI app can access a different service function that in turn invokes the proxy function. In Joe's example, the call to MyIBMiProgram.entry1 is a call to a proxy function that resides in a library named MyIBMiProgram.
***************
With a change, all access would use a similar mechanism:
For service access (an asynchronous access, from Rich UI):
myBindingVar01 IHttp {@Resource {uri="binding:myJavaScriptDDEntry"}};
call MyInterface01.myServiceFunction("abc") using myBindingVar ... etc.
For IBM i access (a synchronous access, from a service generated to Java):
myBindingVar02 IBMiConnection {@Resource {uri="binding:myJavaDDEntry"}};
call MyInterface02.myIBMiFunction("abc") using myBindingVar02 ... etc.
The following rule makes the difference in purpose easy to remember: only a Java service can access a back-end program directly.
(Another detail is that you can set the second binding variable as shown or in two other ways; but we needn't talk about those details until 5 minutes into the lesson.)
[Updated on: Fri, 27 April 2012 14:22] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06007 seconds