DataAccess::Broker DataAccess::[xxx]::Service
- Paires of modules that encapsulate the xxxDataManager calls. The same form module is therefore used in stead of a form module for each method of access. - [xxx] can be any of Sqla, Dbc, Dbi, Rdb depending on the model used to access the database.
See Version in Gtk2::Ex::DbLinker
In the script that start the example
use DataAccess::Dbi::Service; my $dbh = DBI->connect("dbi:SQLite:dbname=./data/ex1", my $data = DataAccess::Dbi::Service->new({dbh => $dbh }); my $app = Forms::Main->new( { gladefolder => "./glade", data_broker => $data } );
In the form module
my $dman = $self->{data_broker}->get_DM_for('country'); sub on_field_changed { my ( $self, $value ) = @_; $self->{data_broker}->query_DM( $self->{subform}->get_data_manager,'speak', [$value]); }
Where country speak are keys that return the arguments for creating or querrying a DbiDataManager instance
To install Gtk2::Ex::DbLinker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gtk2::Ex::DbLinker
CPAN shell
perl -MCPAN -e shell install Gtk2::Ex::DbLinker
For more information on module installation, please visit the detailed CPAN module installation guide.