Python Programming, news on the Voidspace Python Projects and all things techie.
To quote from the wikipedia reference above :
In computer programming, abstraction inversion occurs when a programmer creates simple constructs on top of complex constructs. The correct way is considered to be the other way round - to create complex constructs on top of more basic constructs. Abstraction inversion is an example of an anti-pattern.
I suppose that this is like the typical OS - that starts with very simple components, like instructions to move the hard drive head, and read or write individual bits. On top of that you build file systems and operating systems.
In terms of programmers libraries it does seem that abstraction inversion is something to be aimed for. Wax is a very good example. It takes the complexities of the wxPython GUI toolkit and wraps it with a much simpler interface. My module logintools is another good example. It provides a user authentication, user account management, and account administration, framework for CGIs. This can actually be used within Python scripts with the addition of as little as two lines of code. It provides a simple interface to a more complex engine.
In a way ConfigObj is becoming like that. It started life as a very simple config file reader and it still maintains extreme simplicity of use. Creating new config files, and reading existing ones, can be done with single line commands. However it is about to receive a major update (up to version 3.3.0) which will add unicode capability and config file validation . The inner workings of ConfigObj can be quite complex..... but the interface it provides is as simple as possible. This seems to be one of the design principles of Python, which is why it appeals to me so much.
|||An addition built with Mark Andrews from http://www.la-la.com. The Validator class we have built has wider application than ConfigObj - which now has an interface built in to use it.|
|||The blog client tool, also by Hans Nowak, that I am typing this into...|
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.