Hey Jack,

2011/2/25 Jack <[email protected]>:
> As I was thinking of how to simplify or reorganize, I looked again at
> the dbo tutorial.  I'm not sure how I noticed, but all I had to do was
> move the "public:" in the Trait class definition above the persist
> piece.  I'm still not sure why the persist stuff shouldn't be OK being
> private to the class, since I am only trying to access it within a
> function in the class - or is it because it's a public function, and
> therefore will end up being called in a place where the private stuff
> will not be accessible?

Well, the Dbo code still needs to be able to call the persist()
function and so your code has to make it available. Wt::Dbo uses the
persist() method to manipulate objects of your class (loading, saving,
updating, deleting, creating/dropping the schema).

For situations where you cannot modify an existing class, Wt allows
you to specialize a Wt::Dbo::persist<T> struct which allows you to
define the 'persist()' method outside the class T. But template
specializations are cumbersome (and ASFAIK, this method of defining
the persist() function is currently not even documented).

Regards,
koen

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to