Re: 4gl development question
Posted in 2005
Mike Aubury <mike.aubury@aubit.com> wrote in message news:<421502d7$0$8750$db0fefd9@news.zen.co.uk>...
> I may be way off - but can you use shared libraries rather than
> executables ?
>
>
> Once you've linked the application - that still gives you the chance to
> change just those libraries without a complete recompile etc.
>
>
> Using c4gl...
>
>
> mylib.4gl :
>
> function inc(a)
> define a integer
> return a+1
> end function
>
>
> myprog.4gl :
>
> main
> define a integer
> let a=inc(1)
> display a
> end main
>
>
>
>
> $ c4gl --shared mylib.4gl -o libmylib.so
> $ c4gl -o myprog myprog.4gl -L. -lmylib>
>
>
>
>
> Not that it will help - but Aubit4GL allows calls to shared libraries
> directly without even linking them to your program (notation is similar to
> perl) :
>
>
>
> $ 4glpc -as-dll mylib.4gl -o mylib.so
>
> myprog.4gl:
> main
> define a integer
> let a=mylib::inc(1)
> display a
> end main
>
> $ 4glpc myprog.4gl -o myprog
> $ ./myprog> 2
>
>
>
>
>
>
> Neil wrote:
>
> > The way our 4gl application has evolved we make use of system calls to
> > execute other programs rather than linking in that functionality
> > directly to the calling program.
> >
> > For example this leads to the following type of code
> >
> > program1: begin work
> > .......
> > commit work
> > run "program2"
> > begin work
> > .......
> > commit work
> >
> > with the transactions being commited prior to the call to avoid locking
> > difficulties.
> >
> > This has worked (made to work) but has never been ideal as we should
> > really have a single transaction.
> >
> > Now we have a requirement to keep the work in a single transaction I was
> > wondering if there is an elegant way of having two 4gl programs
> > effectively share the same connection (and transaction). My fallback is
> > to rework the code and link in the appropriate modules but this will
> > lead to bigger executables, more maintenance and will take some time to
> > achieve ... I'd rather not do this.
> >
> > My thinking was that I could use esqlc to replace the system call in
> > program1 and the main module of program2. This would involve binding the
> > programs together via sockets, passing the named connection from
> > program1 to program2, setting the connection within program2 and
> > fgl_start program2.
> >
> > I'm sure this problem has been seen before so the big questions are is
> > this approach doable and what are there alternatives ?
> >
> > Regards
> > Neil
Hi
And, I can suggest you ... why not write the other parts in STORED PROCEDURES ??
BR Ferro