That's like asking for the chocolate back after you've made chocolate milk!
This post concerns a tragedy in API design. While it is often convenient to have your API receive compound data, it is a bad idea.
The first argument to connect is compound data. It is a single string argument, but it contains important subelements:DBI->connect("dbi:mysql:database=sakila;host=localhost;post=3306", $username, $password);
So, what happens if you've been using DBI and you have all your connect data in configuration files with DSN strings and then you decide you want to start using Rose::DB::Object? You have to find some way of getting the chocolate back from chocolate milk --- you have to break down the compound data in the dsn in order to get out the sub-elements.__PACKAGE__->register_db( driver => 'pg', database => 'my_db', host => 'localhost', username => 'joeuser', password => 'mysecret', );
So "hithere" is compound data. The octothorpe is shorthand for id and "hithere" is the value of an id... that's two things packed into a single scalar.$zoom->select('#hithere');
and similar to class lookdowns, etc.$zoom->id('hithere');
The HTML::Element look_down() method had an excellent non-compound approach.
That being said, the current API meshes well with the jQuery API and it also intuitive for web designers, so there are definitely some reasons for why it is OK.
you have compound data, which you need to "normalize" via bugs/old, bugs/new, bugs/closeddrwxrwxrwx ... bugs-old drwxrwxrwx ... bugs-new drwxrwxrwx ... bugs-closed
-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"
|
|---|