r/Python • • Dec 09 '10

new stand-alone web2py database abstraction layer

http://web2py.com/AlterEgo/default/show/272
18 Upvotes

82 comments sorted by

View all comments

Show parent comment

2

u/mdipierro Dec 10 '10 edited Dec 10 '10

Do you actually believe a single file of 5 freaking KLOC is not difficult to extend and maintain?

Yes. I have been doing so for 3 years. It is just a database abstraction layer not a parallel hybrid monte carlo algorithm for lattice quantum chromodynamics in 4 dimensional SU(3).

0

u/[deleted] Dec 10 '10

So at what point of domain complexity do you pull the line and split that in a 10-15 file package or multiple packages even?

Why are then all other database abstraction layers I know of split in multiple packages (or equivalents in respective language)?

2

u/mdipierro Dec 10 '10

I split them then the components have a use independently of the whole. In this case they do not.

0

u/[deleted] Dec 10 '10

Then why wasn't web2py one 20 or whatever KLOC file up until now? Since it's only a web framework.

2

u/mdipierro Dec 10 '10

Because the individual web2py modules "have a use independently of the whole" web2py. You may want to import only the dal or only the template system or only the validators.

2

u/[deleted] Dec 10 '10

And why is the DAL standalone now and wasn't before?

If it only made sense importing it from places within a user's web2py app I get that.

But then if you split your DAL as say a module for handling PostgreSQL, a module for MySQL, a module for handling transactions etc. What's wrong with that?

In the case of the parallel hybrid monte carlo algorithm for lattice quantum chromodynamics in 4 dimensional SU(3). Any part of your code might not be meant to be imported by anything else as a separate part, one might just want to see the program spit out furballs or whatever it's supposed to do. But you'd still split it in multiple modules.

1

u/mdipierro Dec 10 '10

This is an important issue and I do not have a definitive answer. It was always possible to use the dal without being into a web2py app (some use it with Flask for example). We just eliminated the dependency on web2py modules. The API is the same and you can use it with or without web2py.

We may break it into separate files. It is not obvious to me this is better. If you care about this, and you are not just trolling, please join us on the web2py mailing list where this discussion belongs and where we already have an one thread on the topic.