Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of "Core" as a member name suffix

Note: I just want to say up front this is a very minor question - purely a curiosity.

What is the meaning when a member is named with a suffix "Core"?

Other examples of members using the "Core" suffix off the top:

  • SearchCore
  • SortCore

I just came across it in the WAF framework and have a theory - could it come from the visual cue that the type name between <>'s (which is the type of the member ViewCore) making it look like a "core" of sorts?

enter image description here

like image 974
Aaron Anodide Avatar asked Mar 23 '13 02:03

Aaron Anodide


2 Answers

In section 9.9 Template Method (p.355) of "Framework Design Guidelines" by Krzysztif Cwalina and Brad Abrams states:

Consider naming protected virtual members that provide extensibility points for nonvirtual members by suffixing the nonvirtual member name with "Core".

public void SetBounds(...) {
    ...
    SetBoundsCore(...); // [Extension Point]
}
protected virtual void SetBoundsCore(...){...}

The template method patter allows you to preserve execution logic and control certain pre and post behaviors after a derived class executes the extension method.

like image 64
Austin Avatar answered Nov 16 '22 12:11

Austin


Core is usually used as a keyword when you are looking at the very fundamentals of a class. In general these classes contains the very basics of the application, relaying on the bare minimum dependencies to make it easy to use the code throughout your application, or other applications.

like image 4
eandersson Avatar answered Nov 16 '22 12:11

eandersson