Managers
Definition
The idea
is to have Objects capables to be used for all what is needed and used
by computers.
"ALL"
will say "all", drivers, programs, DLLs, ... ALL
Another
spec. is that they must be downloadable on a communication channel,
including a network. But also from a local "server".
They must
be autonomes, not depending from any other software as much as possible.
Idealy
they would load also alone.
Those main
specifications result in many things and restrictions. One is that a
Manager may use others. And it can be an assembly of lower level objects.
This resulting in no limit of size and complexity.
Objects
have properties and methods. So many Managers can use
the same methods and thus the same code!
For example
a PPP Manager shall haveone piece of code used by many communication
channels; properties shall be different (and MUST be!), but methods
should be the same.
To be capable to download and be autonomous results
in the code needing to be relocatable or/and to load through a 'loader".
Managers are objects and so they have properties
and methods.
Methods are simply the functions a Manager can use. Thus they are the
"program" or better the code associated to a type of Manager.
Managers definde in C++ inherit code from their ancestors and from the
underlying Managers.
Trakian has been defined in the past in C++. But C++ is not portable to
all microprocessors because most of small processors have no C++ compiler.
C is more portable, mostly processors have at least a C compiler availlable.
Thus Trakian is now defined in ANSI-C.
This not restrict objects, C++ is basically a C compiler,
but the compiler takes in charge at compile time a lot of thinks most
programmers have not conscience of. This concerns mostly the operators
new and delete and the constructor and destructor of objects.
For Trakian's Managers, no C++ compiler can take this
in charge and thus those operators and constructors are defined in the
Manager itself as one of the properties it can execute.
Due to inheritance, many Managers use their ancestors's
"methods" to conctruct themselves. But Trakian is not "compiled".
A Manager can be loaded at any time and can be discarded. To do this
a kernel Manager is used to manage the Memory and it tales in charge
the allocation/deallocation of the memory space used by the Manager.
And here is needed to define what are the Manager's
properties.
For each instance of a Manager exist a structur defining this instance.
Speaking of a Manager, it is more speaking of this structur than of
the methods. And many instances of some Manager can exist at the same
time, anyone having a private structur and so some private area in memory,
where all datas of this instance are defined.
And this is the real "Manager"!
Because the inheritance, all Managers have ancestors
and the bottom of is a simple "Manager" doing nothing else
what all other can do. This is the "Base Manager" having the
minimal size, and having the methods needed by all childs. It can respond
to a lot of general messages and can execute a lot of actions like for
example to link to other Managers.
And thus a "kernel" if existing or any other Manager know
this and can request to another Manager to execute some task.
And the kernel itself is simply a Manager with his own methods!
The Memory Manager also, the one replacing the operator "new"
of the C++. And so, to create a Manager is simply to request to the
Memory Manager to alocate the memory space needed and to initialize
the new instance. C++ does this by calling a constructor. Trakian does
the same, the "method" being in the "class" of this
new instance!
A Manager exchanges and receives messages with/from
others. This is mostly a procedure part of the methods of a class. This
procedure has 4 parameters, the first one being a long pointing to the
properties (lets say the Manager) of the instance involved. This is
classic for object languages, C++ does the same with "this",
a pointer allways existing and used by the compiler when required.
A procedure shall thus receive messages and execute
the request. Almost similar to what is called a "Window procedure"
for whose common to use MS-Window.
A procedure can return to the caller immediately if
the request is fullfilled. But most calls are not existing in the class
but part of an ancestor class. And so many messages are executed "by
default" by this ancestor class.
A procedure in C is so simply "case xxxx: ............" with
mostly a "default: ........" statement, or another technic
used to call the ancestors. Noting here that this ancestors has also
a procedure, is also called by this procedure and so shall eventually
call itself the same ancestor procedure. Thus, its to control if no
redundant calls shall be executed.
Noting this: if a class is included in another, Trakian calls normally
(like C++) the conctructor of the base class with a pointer to this
part of the Manager. Eventually it can later do some changes to what
has been done by the base class'Manager. But mostly the base Manager
has done excatle what was needed.
And thus, conctructors of a class just call the base class's constructor
and initialize the properties smecific to the new class.
|