djoproject / pyshell

An advanced shell support in python to quickly write a shell
GNU General Public License v3.0
3 stars 0 forks source link

SYSTEM/Split manager class #109

Open djoproject opened 7 years ago

djoproject commented 7 years ago

TODO starting hash will disappear and other update will be applied in the manager (see #111), but probably a link to original parameter will remain because of the reset commands. Update this issue as soon as it is decided.

Description

At the beginning, only the parameters needed the manager, but now, commands and addons will be stored into a manager:

The idea is to split the manager class into four classes that inherit from each other:

TODO

Depends upon

Dependency for

djoproject commented 7 years ago

0 New approach: split in services

One and only one kind of node, no more node inheritance. This node will hold a list of services and nothing more, no value. Each service must be as much independent as possible from the others.

There are currently 3 services:

More services could appear in the future without needing a new refactoring of the manager classes. A node without any service has no purpose and must disappear.

To combine services, just create a class inheriting from the needed managers. It must be as simple as that.

1 The abstract manager, the service node and the abstract service

1.1 Abstract Manager Class

1.1.1 Fields list

1.2 Service Node class

1.2.1 Fields list

1.3 Abstract Service Class

1.3.1 Fields list

*

1.3.2 Methods list

2 Basic service

2.1 The basic manager class

2.1.1 Fields list

2.2 The basic service class

2.2.1 Fields list

3 Scope service

3.1 The scope manager class

3.1.1 Fields list

*

3.1.2 Methods list

*

3.2 the scope service class

3.2.1 Fields list

4 Origin service

4.1 The origin manager class

4.1.1 Fields list

4.2 The origin service class

4.2.1 Fields list

4.3 Problems with this design

4.3.1 parameters added without any origin, need a default group ? how to track them?
4.3.2 origin is not independent, because it adds the parameter either in basic service, either in scope service
4.3.3 if it is possible to add a group in local or in global scope, need to know where it was added before to call the removeGroup. And also need to manage the case whene removeGroup is called with another local key than the key used for the addGroup