i am a progress beginner and not clear about persistent procedure and its uses.
Can anyone say where it is live project with example
difference between persistent and super procedure
Running a procedure persistently means that you can then run its public internal procedures from another running procedure i.e., both are available at the same time. A super procedure is just a special persistent procedure which has been made super so that it extends the name space. By this I mean that with an ordinary PP containing a IP called X one has to say run X in hPP (where hPP is a handle to the PP). With an SP, one can just say run X and it will find out where in the super stack it is.
Running a procedure persistently means that you can then run its public internal procedures from another running procedure i.e., both are available at the same time. A super procedure is just a special persistent procedure which has been made super so that it extends the name space. By this I mean that with an ordinary PP containing a IP called X one has to say run X in hPP (where hPP is a handle to the PP). With an SP, one can just say run X and it will find out where in the super stack it is.Stop receiving emails on this subject.
Flag this post as spam/abuse.
A persistent procedure can be compared with a class based object.
Just like you "new" an object, you can persistently run a procedure.
The procedure "persists" after the RUN statement (it is still there in memory, and you can run internal procedures in it).
DEFINE VARIABLE libraryHandle as HANDLE NO-UNDO.
RUN library.p PERSISTENT SET libraryHandle.
RUN InternalProcedure IN libraryHandle.
Be aware that unlike class based objects, persistent procedures don't get garbage collected when they go out of scope, so you'll have to explicitly delete them to prevent memory leaks:
DELETE PROCEDURE libraryHandle.
And while it might have been interesting at the time, I would advise you not to use super procedures. They only make debugging code harder, and don't favor clean code/design...
I do not have the same negative view of persistent procedures and super procedures as Lieven has. I’ve made pretty positive experience with them (also in the ADM2 framework that fully relies on them). When used properly they allow you to structure code pretty much in a similar way as OO would.
But when it comes to a need of writing new code that requires “inheriting” functionality OO (classes) is a much better way to go anyway.
I have no problem with persistent procedures, just with using them as super procedure... ;-)
Don't you see them as the non-OO version of a STATIC, with all that implies?
-----BEGIN PGP SIGNED MESSAGE-----
not even by far, super procedures can be deleted and one can clean them
out all going through the session/this-procedure supers.
static access is strongly typed, nothing like run x in super where you
don't know/care where the darn procedure in implemented.
persistent/super procedures were great in the pre-oo age, inheritance
could be easily simulated with chain of super procedures just not set
for the session but for the procedure...
On 08/21/2014 05:10 PM, Thomas Mercer-Hursh wrote:
>[collapse] From: Thomas Mercer-Hursh
> Post: RE: persistent procedure
> Posted in: OpenEdge General
> Link: http://community.progress.com/technicalusers/f/26/p/12019/44419.aspx#44419
> Don't you see them as the non-OO version of a STATIC, with all that implies?
> You were sent this email because you opted to receive email notifications when someone created a new thread.
> To unsubscribe[collapse] from:
> - ...only this thread, disable notifications at http://community.progress.com/technicalusers/f/26/p/12019/44419.aspx#44419.
> - ...all email notifications from Progress Community, navigate to "Settings", click on the "Email" tab, then under the "Email Configuration" section, set Send Notifications to "No".
keep it simple
mobile: +40 740 036 212
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
-----END PGP SIGNATURE--[/collapse][/collapse]
You know better than to think that I was suggesting that they were equivalent. I was just exploring Lieven's objection by suggesting that one used them for similar purposes, i.e., extending the name space for common functions.