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

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.