Problem:
I am trying to create a completely modular piece of software. I thus want to avoid anything monolithic.
I have a root file which calls the other libraries. I want to get some of the functions I define in these libraries into global namespace, so that I don't have to redefine them in other places.
ie:
Root defines grabber function
|Grabber gets parser
|Grabber gets User handler
| |Defines Create_New_User()
| |Defines Change_User()
| |Defines Delete_User()
| |Defines Get_User_Info()
|Grabber gets Session Handler
|Defines Create_Session()
| |Needs Get_User_Info() to do it's job
|Defines Delete_Session()
Now I see three options:
1)Define a function in the global namespace(Root file) that pulls together the functions of User and Session
2)Place all my functions in the Global namespace and give up on the modularity idea.
3)Reinclude User into Session (Causing all kinds of redefinition errors..
4) Combine User (huge) with Session (tiny), where I would load User even in situations where I would not use it.
Someone please help with this. If it's possible to insert a function into the global namespace without having to resort to the methods above and keeping the modularity of the program, it would be a big help.