IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
KB
   ► KB ► > Partial Class Posts  Print This     

Partial Class Posts

"Partial Class" Knowledge Base Posts

More...
  KB Article    

Mike Prestwood
1. Delphi Class Helpers (class helper for)

Delphi allows you to extend an existing class without using inheritance. Buggy in 2005 and not officially supported but stable and usable in 2006 and above. You declare a class helper similiar to how you declare a class but use the keywords class helper for.

  • You can name a helper anything.
  • Helpers have access only to public members of the class.
  • You cannot create an object instance directly from a class helper.
  • self refers to the class being helped.
Posted to KB Topic: OOP
13 years ago, and updated 12 years ago
(1 Comments , last by Leo.M )

Code

Article
Nothing New Since Your Last Visit  
28802
Hits

Pascal and Delphi Coding

Mike Prestwood
2. Class Helper

A. In Dephi, class helpers allow you to extend a class without using inheritance. With a class helper, you do not have to create and use a new class descending from a class but instead you enhance the class directly and continue using it as you always have (even just with the DCU).

B. In general terms, developers sometimes use the term to refer to any class that helps out another class.

Posted to KB Topic: Object Orientation (OO)
13 years ago, and updated 13 years ago

Definition
Nothing New Since Your Last Visit
10267
Hits

Coding & OO

Mike Prestwood
3. Delphi Prism Finalizer (finalize())

Unlike Delphi, Delphi Prism uses the .Net garbage collector to free managed object instances. Prism does not have nor need a true destructor.

In .Net, a finalizer is used to free non-managed objects such as a file or network resource. Because you don't know when the garbage collector will call your finalizer, Microsoft recommends you implement the IDisposable interface for non-managed resources and call it's Dispose() method at the appropriate time.

Posted to KB Topic: OOP
13 years ago, and updated 13 years ago

Code

Article
Nothing New Since Your Last Visit  
21151
Hits

Delphi Prism

Mike Prestwood
4. Delphi Prism Member Field

In Prism you can set the visibility of a member field to any visibility: private, protected, public, assembly and protected or assembly or protected. Prism supports the readonly modifier for member fields which is handy for constant like data. In this case, I chose not to preface my read-only member field with "F" so it's usage is just like a read-only property. Prism also support the class modifier (static data) for member fields. Delphi developers should notice the use of := to initialize a member field (in Delphi you use an =).

Posted to KB Topic: OOP
14 years ago, and updated 13 years ago
(1 Comments , last by mtiede )

Code

Article
Nothing New Since Your Last Visit
13602
Hits

Delphi Prism

Mike Prestwood
5. C# Member Method

In C# you can set the visibility of a member field to any visibility: private, protected, public, internal or protected internal. You can intialize a member field with a default when declared. If you set the member field value in your constructor, it will override the default value. Finally, you can use the static modifier (no instance required) and readonly modifier (similar to a constant).

Posted to KB Topic: OOP
14 years ago, and updated 13 years ago
(2 Comments , last by Lorivers.H )

Code

Article
Nothing New Since Your Last Visit
14463
Hits

C# (Visual C# & VS.Net)
More...


Icon Legend:
Since your last logged visit:
- New to you or updated since your last visit (sign in now to activate).
- NOT new to you since your last visit (sign in now to activate).
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2022 Prestwood IT Solutions.   [Security & Privacy]