Archives for: June 2006, 28
The Fourth Way
June 28th, 2006Ted Neward has written a good discussion of Object-Relational Mapper concerns. I'd like to react to, and associate, a couple of points he makes, seemingly unrelatedly:
...we typically end up with one of Query-By-Example (QBE), Query-By-API (QBA), or Query-By-Language (QBL) approaches.
A QBE approach states that you fill out an object template of the type of object you're looking for...
a "Query-By-API" approach, in which queries are constructed by Query objects...
a "Query-By-Language" approach, in which a new language, similar to SQL but "better" somehow, is written...
and
Several possible solutions present themselves...
5. Integration of relational concepts into the languages. Developers simply accept that this is a problem that should be solved by the language, not by a library or framework...bring relational concepts (which, at heart, are set-based) into mainstream programming languages, making it easier to bridge the gap between "sets" and "objects"...[such as] direct integration into traditional O-O languages, such as the LINQ project from Microsoft...
I propose (and implemented in Dejavu) a fourth approach from QBE, QBA, and QBL. Rather than build a DSL on top of a programming language (as QBL does), use the language instead. Rather than change the programming language by introducing relational syntax (as LINQ does), use the language instead. In Dejavu, you write plain old Python functions which take an object and return True or False. Iterate over a collection of objects and it works as a filter. Pass it to the storage backend and it is translated into SQL for you. Most commonly, you pass it to the library and it does both for you: iterates over its in-memory cache of objects and merges in new objects, queried from storage. Let's call it... "query". It's not "by" anything. It has an infinitesimal learning curve. LINQ is, in essence, shoehorning higher-order functions into its various target languages in a very limited domain. Why not use a programming language that has real HOF's?
Social Isolation
June 28th, 2006The Washington Post (and many other media) recently posted an article about "Social Isolation in America." Some meaningful-to-me quotes:
"Americans are far more socially isolated today than they were two decades ago, and a sharply growing number of people say they have no one in whom they can confide..."
"A quarter of Americans say they have no one with whom they can discuss personal troubles... Overall, the number of people Americans have in their closest circle of confidants (is) about two."
"We're not saying people are completely isolated. They may have 600 friends (via the internet) and e-mail 25 people a day, but they are not discussing matters that are personally important."
"Putnam and Smith-Lovin said Americans may be well advised to consciously build more relationships."
Why is this topc meaningful to me? Because I have been thinking about and trying to "consciously build" relationships that are close, in which I can discuss matters of importance (beyond superficial). Two things have happened in my family's life in the past two years that have made their mark on me and how I see relationships:
Through a time of unemployment, I came to realize that receiving significant support from people really meant that I needed their relationships first and their physical assistance (meals, toys for our kids at Christmas, etc.) second. If I as the receipient don't know you (the giver), your giving might seem to me to be "just throwing money at a problem." However, if we have a relationship in which we've supported each other in the past, your giving will probably seem like something that friends do for each other and will be a true blessing.
We recently changed churches to one that is in our community (rather than one that was 20 highway minutes away that draws people from a 20-mile radius). It has been a difficult change because of the lack (so far) of intimacy in relationships there. One of our hopes upon going to a church closer to home was greater abilty to have intimate relationships because the people we now go to church with live closer to us than those we attended church with before.
What have I been learning? First, I will always have to be an initiator in both beginning new relationships AND in continuing those that I desire to deepen. Second, I don't want the "600 friends" mentioned in the article; rather, I want a handful of close friends who live in my community that help me meet social needs at 3 levels: for me as a woman (daughter, wife, mother, and friend), for my husband and me as a couple with other couples, and for our family of 4 with other families.
The closer I get to 40, the more I am de-cluttering my life of knick-knacks and things I haven't used in forever in an attempt to streamline my surroundings. I've noticed this is happening in my approach to everything, including relationships. I don't want to waste time reading "joke" emails that get sent around the world, or catching up on the latest catalog sales. I want to be face-to-face in relationship with people discussing and living life together. How about you?