Connectivity to Web Services issue

RealHeavyDude

Well-Known Member
Sorry, I was a little bit in a hurry when I posted the code. You are right - doesn't make much sense.

As I have already explained, I would never put the connection to any service in the constructor of the class. If the connect fails you have no way to instantiate the class gracefully. You need to make sure that a piece of code that removes the dynamic objects that you have created in your class ( in your case the server object ) is reached when something goes wrong. As an alternative, if you are familiar with how widget-pools behave, you could use the USE-WIDGET-POOL option on the CLASS statement. That way it is ensured, if not specified otherwise, that dynamic objects that are created in the class are put into an unnamed widget pool that is scoped to the class instead to the one scoped to the session.

Heavy Regards, RealHeavyDude.
 

b-707

Member
Sorry, I was a little bit in a hurry when I posted the code. You are right - doesn't make much sense.

As I have already explained, I would never put the connection to any service in the constructor of the class. If the connect fails you have no way to instantiate the class gracefully. You need to make sure that a piece of code that removes the dynamic objects that you have created in your class ( in your case the server object ) is reached when something goes wrong. As an alternative, if you are familiar with how widget-pools behave, you could use the USE-WIDGET-POOL option on the CLASS statement. That way it is ensured, if not specified otherwise, that dynamic objects that are created in the class are put into an unnamed widget pool that is scoped to the class instead to the one scoped to the session.

Heavy Regards, RealHeavyDude.

RealHeavy, thanks for your input. I'll definitely re-factor my approach. But this is not the highest priority right now. This never bugged business so far.

As I said (http://www.progresstalk.com/showthr...ity-to-Web-Services-issue&p=376926#post376926)
This really doesn't matter what style of coding I use. This fails even from within plain old procedural flow.
 
Top