[progress Communities] [progress Openedge Abl] Forum Post: Re: Is This "clobject1"...

  • Thread starter Thread starter Peter Judge
  • Start date Start date
Status
Not open for further replies.
P

Peter Judge

Guest
AS other have pointed out, there are a few approaches you can take. The most common pattern is something along the lines of class MyClass: define public static property Instance as class MyClass no-undo get (): if not valid-object (MyClass:Instance) then assign MyClass:Instance = new MyClass(). return MyClass:Instance. end get . set . // prevents anyone other than this type instantiating constructor private MyClass(): end constructor . // Add normal instance methods, properties etc end class . This is the singleton pattern (start at en.wikipedia.org/.../Singleton_pattern ) and you’ll find in general programmer-dom that people have strong feelings about using this pattern and how it’s implemented. The pattern ensures that you have one and only one instance of this type at any given time. In general I would warn against making decisions (program flow) inside a finally block. Note that there were some changes made in 11.4 to the behavior of flow-control statements in a finally block (in the doc at OpenEdge® Getting Started: New and Revised Features 11.4 Feature Comparisons : RETURN statements in a FINALLY block documentation.progress.com/.../OpenEdge.40.html )

Continue reading...
 
Status
Not open for further replies.
Back
Top