Closed DanielBullimore closed 4 years ago
I know this is the draft, but...
Although the master class can be nameless, in multi instance situations being able to name the instances would be good programming.
Becuase strName is a private property, developers can't name a class instance, not even decendent classes can.
I recommend ether a protected method which sets strName so long as strName is null.
Or
Passing the instances name as declaration parameter example test = new OO("strName)
Link to Feature List: #8
Testing Method:
The master class is invisible to users thus manual testing is not possible.
Testing will be conducted using two html files: OOSingleInstance.html, OOMultiInstance.html; Each testing page will link the OO class file into its header.
a. Single instance testing:
Open OOSingleInstance.html in each browser being tested.
b. Multi Instance Testing
b.a. Pretest Setup:
b.b Testing:
funSetName()
then attempt to rename one of the two withfunSetName()
Destroy()
for remaining instances[Attach / Upload testing program and link it]
Pass Criteria
1. Security, Accessibility & Visibility:
1.1.1. Class name exists in global namespace.
1.2.1. Class name still exists in global namespace.
-
2. Interface & display:
-
-
displays no output.
3. Persistent Memory:
(what does the system know about this feature?)
3.1.1. Again the class OO() exists in global namespace. 3.1.2. After declaring a new instance of the class:
numId
strType
strName
window.rayOO
&window.rayOOi
will exist and be type objectDestroy() Initialise() funGetObjectByName() funSetNameOnce() funGetName() funGetId() funGetType()
methods3.2. Post testing state:
3.2.1. After calling
funInitialise()
method:intId
interger value must be a numberstrType
string must be oomutinystrName
must be null, the master class has no namewindow.rayOO
andwindow.rayOOi
exist and are multi-dimensional type arrayrayOO["oomutiny"][0]
exists and is the object handle for the test instance of OOstrOO()
does returns a string for calling itself within html events, example onclick and on load.objOO()
does return its object handle fromrayOO
within the javascript namespace.domOO()
could return a DOM element node with node id derived from its type concatinated with its id.3.2.2. after calling
funGetByName("")
the method has returned the test instances javascript object handle.3.2.3. calling
funSetName("test")
thenfunGetByName("test")
did returm the test instances javascript object handle. Set name only works once per instance and must be unique per OO object type.3.2.4. After calling
Destroy()
when a single initilised instance of OO exists:window.rayOO
andwindow.rayOOi
contain zero items and no longer exist3.2.5. after calling
Destroy()
when multiple instances of OO are initialised:window.rayOO
andwindow.rayOOi
must still exist -rayOO["oomunity"]
must still contain the other test instances object handles -rayOO["oomunity"]
does not contain the test destroy instance -OO class still exists in javascrip namespaceOther/Notes:
This class has broken from the coding standard naming convention but its OK, its the master class. It needs not even initialize in script yet its decedents will inherit its form while retaining the standard. Many of the properties and methods exist solely to provide structure for descendant classes.
4. Restrictions:
4.1. OO does not need to be initialized as an object for its decedents to initialize. However should a developer initialize two or more instances, destroying one instances must leave the other instance fully functional. Its just good programming.
5. Exceptions:
5.1. funSetName() method must return false when a object of given type already has that name or when the name has already been set, then name wont be set.