One module per class, bad idea?

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Dec 22 20:21:24 EST 2006


At Friday 22/12/2006 20:25, Paddy wrote:

>Are there tools out their to help with the refactoring task of
>splitting a module into two or more sections then showing what other
>files need to change?

Usually no other files need to change. Ex: you have BigOldModule 
including ClassA, ClassB and FunctionC. Move each one onto its own 
module, perhaps including a subset of the original imports of BigOldModule.
Shrink BigOldModule to just:

from ClassA import ClassA
from ClassB import ClassB
from functionC import functionC

and maybe a few other things, so all imports from the outside remain 
the same. That's all - most of the time.


-- 
Gabriel Genellina
Softlab SRL 


	

	
		
__________________________________________________ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 




More information about the Python-list mailing list