DanielBullimore / OOmutiny

OO Javascript frontend
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

0.0 Master #8

Closed DanielBullimore closed 4 years ago

DanielBullimore commented 5 years ago

Priority:

Depends:

(O)-[O.class.js]

UML

OOmunity-3-10-2019

Description:

Master is the master class that all other OOmutiny classes will inherit. It will provide functions to control all Mutiny object instances. This class has default initialize and destroy functions. It will provide an index of all object instances declared which inherit it's form. Functions of the Mutiny class will provide its descendants programmatic access to the index of object instances. This will allow programs and programmers to access the properties and functions of all mutiny objects so long as they have the 'focus' of one mutiny object. For example if a user clicks a mutiny object that target object has focus (programmatic access to an instance). Our example target object can then call functions and use properties of any other declared mutiny object to complete its user experience. However a mutiny class tree can still be accessed by its instance name.

Methods:

Initialise() - This function adds a new object to the rayOO multi-dimensional array. This is the minimum constructor for all subclasses of _OO.

Destroy() - Removes a OO object from rayOO multi-dimensional array and namespace.   

funGetObjectByName() - This function searches the global multi-dimensional rayOO array for a object using its type and name.

funSetNameOnce() - set the name of the instance so long as its name is currently unset.

funGetName() - returns string, gets the value of an instances strName property.

funGetType() - returns string,  gets the class type for an instance.

funGetId() - returns number, get the unique number used to identify an instance in the rayOO[class type][ID] global array.

funReactor() - method called by window.event, processes events and reacts to those of significance. the reactor generates interrupts.

Derived Values:

strOO() - returns a string reference to an instance's rayOO entry.
objOO() - returns an instance's rayOO entry.
domOO() - returns the DOM node of an instance's HTML element.

Properties

numId - protected number, unique ident for each instance or sub class instance of Oo. Used in rayOo
strType - protected string, read only, set at class declaration, the name of a object class type
strName - protected string, read only, settable once, the name of a object instance  
rayOO - public array, stores a categorical list of all sub class instances initialized  rayOO[type][id]=object
rayOOi - public array, stores a categorical list of the next id of all sub class instances
objPerfectCircle - public object, contains properties and methods to initiate and control a stable game loop.

Testing Plan: #9

DanielBullimore commented 5 years ago

Leave HTML and the DOM in the 90ies where it belongs. Re-manifest in html5 canvas, this is art. Draw. Also values of private properties may be needed for programming. Consider protected values with funGet methods and no funSet:

funGetType() funGetId() funGetName()

DanielBullimore commented 5 years ago

Leave HTML and the DOM in the 90ies where it belongs. Re-manifest in html5 canvas, this is art. Draw. Also values of private properties may be needed for programming. Consider protected values with funGet methods and no funSet:

funGetType() funGetId() funGetName()

I'm putting these methods in the designs.

DanielBullimore commented 5 years ago

The object index array window.rayOO is decoupled from OO by design, but is this best?

I designed the global array system to simplify implementing the frame work. So long as OO.class.js is linked any child class can just initialize by being declared. Alternatively using the array as a property of OO a developer would first have to declare an instance of OO then an instance of the child class.

The trade off of this easy of implementation is the master index is public. Developers are asked not to directly change its data.

Am I wrong? change my mind.

DanielBullimore commented 4 years ago

OOmunity-3-10-2019

Sanity checking at the end of Stage One Core Feature list finds this class description is well out of sync with current UML diagram.

DanielBullimore commented 4 years ago

OOmunity-3-10-2019

Sanity checking at the end of Stage One Core Feature list finds this class description is well out of sync with current UML diagram.

I have synced this today.

DanielBullimore commented 4 years ago

I have not implement objPerfectCircle. The game loop is not an object class it is an instance of function object.There is only one master game loop, and that is O. If anything other than a public function object, O could be a function of Oo. Also the function funStartLoop calls itself from a setTimeOut ... set time out doesn't like this.function as a parameter ;-) I'm going leave objPerfectCircle as an interface... you know, so implementing developers can give it One...

DanielBullimore commented 4 years ago

Currently the delivered version of OO supports a parameterised declaration. The method was intended for a decendant class to overwrite OO's type property. And it works well. But only for a direct decendant, when a sub class tries to inherit another class's form (which isnt OO) the type can not be overwritten. Fortunatly every class that inherits OO has the .Initialise function. If this function was changed to allow parameterised invokation any decendant of the master class could initialise with its unique type string. Using Initialise method is more effeicent than making every class accept a type parameter and passing that parameter along a chain of declarations though the inheritance tree. Thumbs up to make this change.

DanielBullimore commented 4 years ago

Using Initialise method is more effeicent

You mean Efficient? The most efficient way is to make strType a public variable. Doing so would relinquish a portion of control over the framework that OO posseses as the master class ... and we can't have that. Just imagine implemtation developers changing class type variable willy nilly, it could affect functionality and make people think the framework is poorly designed. Make the changes, run the tests for all delivered to date features. When all features pass their test push the changes to Master branch. This is exactly why the production of the testing documents is part of DBTDD.

DanielBullimore commented 4 years ago

When all features pass their test push the changes to Master branch.

Complete. 100% pass