>> I think it does makes sense to keep SQL confined to well-defined
>> locations. This can be per class - each class holds its own SQL - or a
>> single class that does all database access so all SQL and database
>> dependencies are in one place.
The above is precisely what I'm after, and I agree t
"Kent Johnson" wrote
I think it does makes sense to keep SQL confined to well-defined
locations. This can be per class - each class holds its own SQL - or a
single class that does all database access so all SQL and database
dependencies are in one place.
My vote for the class every time. I h
On Sat, Aug 22, 2009 at 3:54 AM, Alan Gauld wrote:
> "Kent Johnson" wrote
>
can group a bunch of SQL statements in one place; they're currently
scattered all over the program and it's getting unwieldy).
>>>
>>> Normally in an OO program the SQL for each class is in the methods for
>>> th
"Kent Johnson" wrote
can group a bunch of SQL statements in one place; they're currently
scattered all over the program and it's getting unwieldy).
Normally in an OO program the SQL for each class is in the methods for
that
class. That way any changes to the class canbe easily reflected in
On Fri, Aug 21, 2009 at 6:58 PM, Alan Gauld wrote:
> "Serdar Tumgoren" wrote
>
>> I'm trying to create a data-retriever class that executes certain SQL
>> statements based on the name of a calling class
>
> This is a really bad "smell" from an OO design point of view.
>
>> can group a bunch of SQL
"Serdar Tumgoren" wrote
Meantime, how do I pass "self" to DataSources?
Do I literally just pass in the word "self" from inside the calling
object? Apologies for the confusion -- I've never used that technique
before and it's bending my brain a little:)
self is just a reference to the curre
"Serdar Tumgoren" wrote
I'm trying to create a data-retriever class that executes certain SQL
statements based on the name of a calling class
This is a really bad "smell" from an OO design point of view.
can group a bunch of SQL statements in one place; they're currently
scattered all over
> You could simplify the code above by passing self to DataSources(). Or
> make CallerX inherit from DataSources and use the class attribute
> trick we talked about before. Or perhaps you should look into
> SQLObject or SQLAlchemy?
>
The class attribute trick worked nicely. I'll think about how to
On Fri, Aug 21, 2009 at 1:53 PM, Serdar Tumgoren wrote:
> Hi everyone,
> I'm trying to create a data-retriever class that executes certain SQL
> statements based on the name of a calling class (I'm doing this so I
> can group a bunch of SQL statements in one place; they're currently
> scattered all
Hi everyone,
I'm trying to create a data-retriever class that executes certain SQL
statements based on the name of a calling class (I'm doing this so I
can group a bunch of SQL statements in one place; they're currently
scattered all over the program and it's getting unwieldy).
Currently, I'm forc
10 matches
Mail list logo