[pygccxml-development] FT -subst_t
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-10-05 20:00:07
|
Hi. The good new is that I started to work on FT feature. The bad news is that I don't agree with a lot of implementation details and interfaces and this time we will actually fix them. Lets start. subst_t we talked that this class should be implementation details and no one should derive from it, right? Hierachy is the wrong way to declare about implementation details. The solution should be aggregation. This class has ugly interface. subst_t.__init__ method takes as parameter list of block variables names. But when substitute function is called this class looks for variables in self.__dict__. I don't understand why this should be that way. I don't understand why this class has such interface that very easy to break. I don't understand why derived class code_manager_t should have ugly variable names: ARG_LIST_DEF, ARG_LIST_TYPES and etc. This is not coding convention of Py++. This class uses hard coded \n character. This is a mistake. It should use os.linesep character. code_creators_t class already defines indent function. This function should be moved to utils package and reused from both places. I don't understand the substitute method of this class. It defines some logic according to which this method decidec how to indent the line of code. This is just wrong. code_manager_t class understands the meaning of the variable, so it is its respocibility to indent the code. Without subsitute method this class is pretty useless. I think we should remove it. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |