Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tangram::sucks(3pm) [debian man page]

Tangram::Sucks(3pm)					User Contributed Perl Documentation				       Tangram::Sucks(3pm)

NAME
Tangram::Sucks - what there is to be improved in Tangram DESCRIPTION
Tangram has taken a concept very familiar to programmers in Java land to its logical completion. This document is an attempt by the coders of Tangram to summarise the major problems that are inherant in the design, describe cases for which the Tangram metaphor does not work well, and list long standing TO-DO items. DESIGN CAVEATS query language does not cover all SQL expressions Whilst there is no underlying fault with the query object metaphor per se, there are currently lots of queries that cannot be expressed in current versions of Tangram, and adding new parts to the language is not easy. some loss of encapsulation with queries It could be said this is not a problem. After all, adding properties to a schema of an object is akin to declaring them as "public". Some people banter on about data access patterns, which the Tangram schema represents. But OO terms like that are usually treated as buzzwords anyway. HARD PROBLEMS partial column select This optimisation has some serious dangers associated with it. It could either be no support for SQL UPDATE It may be possible to write a version of "$storage->select()" that does this, which would look something like: $storage->update ( $r_object, set => [ $r_object->{bar} == $r_object->{baz} + 2 ], filter => ($r_object->{frop} != undef) ); no explicit support for re-orgs The situation where you have a large amount of schema reshaping to do, with a complex enough data structure can turn into a fairly dif- ficult problem. It is possible to have two Tangram stores with different schema and simply load objects from one and put them in the other - however the on-demand autoloading combined with the automatic insertion of unknown objects will result in the entire database being loaded into core if it is sufficiently interlinked. replace SQL expression core The whole SQL expression core needs to be replaced with a SQL abstraction module that is a little better planned. For instance, there should be placeholders used in a lot more places where the code just sticks in an integer etc. support for `large' collections Where it is impractical or undesirable to load all of a collection into memory, when you are adding a member and then updating the con- tainer, it should be possible to This could actually be achieved with a new Tangram::Type. MISSING FEATURES concise query expressions For simple selects, this is too long: ... non-ID joins tables with no primary key tables with multi-column primary keys tables with auto_increment keys tables without a `type' column tables with custom `type' columns tables with implicit (presence) `type' columns fully symmetric relationships back-refs are read-only. bulk inserts Inserting lots of similar objects should be more efficient. Right now it generates a new STH for each object. `empty subclass' schema support You should not need to explicitly add new classes to a schema if a superclass of them is already in the schema. perl v5.8.8 2006-03-29 Tangram::Sucks(3pm)

Check Out this Related Man Page

Tangram::Expr(3pm)					User Contributed Perl Documentation					Tangram::Expr(3pm)

NAME
Tangram::Expr - represent expressions on database server side SYNOPSIS
my ($r1, $r2) = $storage->remote(qw( ... )); $r1->{field} operator $value $r1->{field} operator $r2->{field2} $r1->{collection}->includes( $obj ) $r1->{collection}->exists( $obj, $filter ) $r1->{collection}->includes_or( $obj1, $obj2, ... ) DESCRIPTION
Tangram::Expr objects represent expressions that will be evaluated on the database server side. Expression objects fall into one of the following categories: numeric, string, reference or collection. Many of the methods in Expr are needed only by people extending Tangram. See also Tangram::Relational, and the source the Tangram::mysql and Tangram::Sybase for examples on how these functions are intercepted to allow RDBMS-specific expressions. NUMERIC EXPRESSIONS
Numeric expression objects can be compared using the operators ==, !=, <, >, <= and >=. The other operand must be either another numeric expression object, or a normal Perl numeric value. The result of the comparison is a Filter. STRING EXPRESSIONS
String expression objects can be compared using the operators eq, ne, lt, gt, le, and ge. The other operand must be either a string expression object or any Perl scalar value. Tangram will automatically quote the operand as required by the SQL syntax. The result of the comparison is a Tangram::Expr::Filter. String expression objects also support the method like($str), where $str is a string that may contain SQL wildcards. The result is a Tan- gram::Expr::Filter that translates to a SQL "LIKE $str" predicate. REFERENCE EXPRESSIONS
Reference expression objects can be compared for equality using operators == and !=. The other operand must be another reference expres- sion, a persistent object or undef(). The result of the comparison is a Filter. COLLECTION EXPRESSIONS
Collection expression objects represents a collection inside an object. It supports the includes() and exists() methods, which returns a Tangram::Expr::Filter stating that the collection must contain the operand. exists() uses a subselect. It also supports the includes_or() methods, which accepts a list and is performs a logical OR - using the IN (x,y,z) SQL construct. The operand may be a Tangram::Remote, a persistent object, or an object ID. operator < is provided as a synonym for includes(). The includes() method can be used for all collection types (Set, Array, Hash, and the Intr* versions). PREDICATES
Predicate objects represent logical expressions, or conditions. Predicates support logical operators &, | and !. Note that a single amper- sand or vertical bar must be used (this is a Perl limitation). The result is another predicate. CLASS METHODS
new($type, $expr, @remotes) Returns a new instance. $type is a Type object corresponding to this expression (see Tangram::Type). $expr is a SQL expression. It will eventually become part of a WHERE-CLAUSE. @remotes contains the Remote objects (see Tangram::Remote) that participate in the expression. Tangram uses this list to insert the corre- sponding tables in the FROM clause and conditions in the WHERE-CLAUSE. INSTANCE METHODS
expr() Returns the SQL equivalent for this expression. type() Returns the Type (see Tangram::Type) corresponding to this expression. objects() Returns the list of the objects that participate in this expression. storage() Returns the Storage associated with this expression. EXAMPLES
$person is called 'Homer' $person->{name} eq 'Homer' $person's name ends with 'mer' $person->{name}->like('%mer'); $person is older than 35 $person->{age} > 35 $person is married to $homer $person->{partner} == $homer $person is not $homer $person != $homer $person is not $homer and is older than 65 $person != $homer & $person->{age} > 65 $person is $bart's parent $person->{children}->includes( $bart ) $person->{children} < $bart $person is not $bart's parent !$person->{children}->includes( $bart ) !($person->{children} < $bart) $person is one of the local list of people, @person $person->in(@person) SEE ALSO
Tangram::Remote, Tangram::Expr, Tangram::Storage perl v5.8.8 2006-03-29 Tangram::Expr(3pm)
Man Page