Macro restructuring - what is available, and where?

Hello!

I'm gonna restructure our macros, mainly because we're about to extend the connection to our webserver with json-requests and POST data.

Today we have a single active macro that uses a php rpc script to fetch data from the database, but with more close integration, I want to use json. And with that, I want to make a central library with the json functionality, base64 encoding, md5 hashing (for cache tricking) and so on.

I've written some macros that uses this, but in those cases I've included a module with the needed functions and public constants in each macro.

Is it possible to centralize it and will the functions, subs and constants be available for other macros if I do?

I feel that I know far too little about the structuring of macros.

Say you have a macro 'a' with all json connectivity and some public constants in a module, then you write a macro 'b' to do some dedicated work that requires db connection. Will it work, and how to do it the best way?

regards,

knutm :-)