dabo framework dependancies
Paul McNett
p at ulmcnett.com
Wed May 23 14:10:28 EDT 2007
Peter Decker wrote:
> On 5/22/07, daniel gadenne <daniel.gadenne at caramail.fr> wrote:
>
>> I'm considering moving over to dabo for wxpython development.
>> However I do not write traditional database applications
>> à la foxpro (I'm a 20 years user of fox...) anymore.
>> Only xml-fed applications.
>>
>> I'm a bit hesitant to jump onboard since dabo seemns to carry
>> over its own lot of database connectivity dependancy.
>>
>> Can you reasonably use dabo for plain datafree application?
>
> That's exactly how I use it. I write apps that don't use database
> servers, and don't have any database programs installed. I just want
> the dabo.ui stuff, since it makes wxPython so easy to work with.
Dabo has three main modules: db, biz, and ui, and an overarching
application object. Every class descends from an abstract dObject. For
database apps, you'd typically set some connection information in the db
layer, put all your business code in the biz layer, and define your GUI
in the (you guessed it) ui layer. You can certainly do what Peter has
done and only use the ui layer and application object. I've done this
myself and if I ever had to code a non-database UI that's probably what
I'd do, too. Although I have to admit I can't really picture an
application that doesn't need to save data. Here's a simple example that
puts up a textbox:
"""
import dabo
dabo.ui.loadUI("wx")
app = dabo.dApp()
app.setup()
frm = app.MainForm
tb = dabo.ui.dTextBox(frm, Value="Type in here", FontBold=True)
app.start()
"""
You can easily define your own subclasses, too:
"""
import dabo
dabo.ui.loadUI("wx")
class MyRadioList(dabo.ui.dRadioList):
def initProperties(self):
self.Choices = ["Snakes", "Bees", "Fishes"]
def onHit(self, evt):
print "Radio choice '%s' selected." % self.Value
app = dabo.dApp()
app.setup()
frm = app.MainForm
rl = MyRadioList(frm)
app.start()
"""
So, yes, you can reasonably use Dabo even if you have no traditional
database in the mix.
--
pkm ~ http://paulmcnett.com
More information about the Python-list
mailing list