Opened 17 years ago
Closed 17 years ago
#2445 closed New Feature (fixed)
V3: Private variable and functions in the code
Reported by: | Frederico Caldeira Knabben | Owned by: | Frederico Caldeira Knabben |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | |
Keywords: | Confirmed V3ProtoStruct Review+ | Cc: |
Description ¶
Whenever possible, the CKEditor prototype code defines private stuff inside closures, so the CKEDITOR object and the window scope remain clean.
In some cases, specially on classes, there are private things that we to be defined "per instance". There is no way to define those privates on closures, so those kinds of things must be defined as properties in the objects itself.
To have a clean code, making also the DOM inspection clearer, a standard has been used in the prototype. All private things are defined under a single property called "_" (underscore).
To have an overview of the effect we have with it, just open any of the samples and select the DOM tab in FireBug. Then, navigate through the CKEDITOR object tree. You will find things like CKEDITOR._ and CKEDITOR.plugins._.

Change History (3)
comment:1 Changed 17 years ago by
Keywords: | Review? added |
---|---|
Owner: | set to Frederico Caldeira Knabben |
Status: | new → assigned |
comment:2 Changed 17 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:3 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
