Re: [gnome-db] bussines logic



On 10/29/07, Kresimir Culin <kculin yahoo com> wrote:
> hello,
>
> This is my first submission to gnome-db mailing list.

Hi!

> First I want to tell you that I am quite impressed with both libgda and libgnomedb.
>
> Nice clean interfaces, pretty consistent API ,
> GOOD WORK GUYS !!!
>

Thanks :)

> I have a question.
>
> How do I enforce business logic.
> I tried GdaDataModelQuery with MySql backend.
> (libgda 3.0.1 and libgnomedb 3.0.0)
>
> 1. GdaDataModelQuery doesn' t emit "row-inserted","row-removed","row-updated"
>    (maybe I should file a bug report)
> 2. proxy does.
>
> but that leads to next question.
>
> If I want to enforce a business rule , and I want to be sure that It want be bypassed
> whether particular table  used by grid/form or my own code, what are my options:
>
> signals exists on:  model / proxy / GdaDataModelIter.
>
> It would be nice to have
> before-insert, after-insert, before-update, after-update, before-delete, after-delete
> somewhere  (where I could be sure they will be triggered in all possible scenarios)
>

"Busness" logic (that is tests to accept/deny data modifications based
on some of your own rules) can be done at when using a GdaDataProxy
(which Libgnomedb uses for its grid and form widgets): either using
the "row-to-change"  signal from the GdaDataModelIter object (so you
can check each individual value change in any field), or using the
"pre-changes-applied" and "post-changes-applied" from the GdaDataProxy
itself when the user "validates" a batch of modifications.

Please note that for all of these signals, you'll have o return a
boolean value to "tell" if you accept the changes or not.

Tell me if it does not answer your question.

Regards,

Vivien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]