Al Boldi wrote:
Joao Morais wrote:
Al Boldi wrote:
Of course you are not caching any relational data, but you said that you
are using a connection broker to the rdb, which caches the rdb data,
which means extra overhead.
Hmmm... the rdb or the suite that access the rdb caching data means
extra resource usage I think, on behalf of performance.
Exactly. But you wouldn't want to do this caching twice.
I think my comment wasn't fair. First: the suite doesn't cache data, the
OPF opens an unidirectional dataset, read all records and release it.
The connection manager has the ability to prepare and unprepare
datasets, but this feature wasn't implemented yet (iirc).
Database does cache and I personally don't mind. If you don't want db
cache (??), you just need to change its configuration.
Ok, I had a quick look through the docs, and it seems that you have the
design tightly coupled to the MVP.
The MVP _is_ the design, or even better, is the presentation framework.
Oh, I meant the OPF design. Is it possible to isolate the OPF from the MVP?
Ah yes, they are completely decoupled. You can:
var
VClient: TClient;
VClientList: TPressProxyList;
begin
VClient := TClient.Create;
// or
VClient := TClient.Retrieve('1');
// or
VClientList := PressOPFService.OQLQuery(
'select * from TClient where name = ''SomeName''');
if VClientList.Count > 0 then
VClient := VClientList[0].Instance as TClient;
// or use a query class
// and then
VClient.Name := 'AnotherName';
VClient.Store;
VClient.Free; // with respective try/finally, of course
end;
Is there a way to directly attach LCL
objects to your OPF?
You don't need to do this. Eg: create a form without code or non-visual
components, bind BO attributes and components in a single line, and the
MVP will do the rest for you using informations from the model.
Sure, this is great when you are working with a disconnected presentation
layer like a web interface. But for native apps, you don't need this,
because your presentation layer is already connected to your model via
TForm. So what we need is for a TForm to directly connect to the OPF
without going through the redundant MVP framework. Is this possible?
Redundand!? No, no! You simply cannot compare a form with three combos
and two grids between dbware and mvp approaches. The former will eat
five groups of data access components, shortcuts to include some
funcionality and a lot of time to configure and debug everything. MVP
will eat five lines of code, nothing more. The same model that will
manage this controls, will also generate the DDL necessary to build the
database metadata for you.
BTW, as I said, the MVP would be great for a disconnected presentation layer
like in web development, so it would be really useful to have an MVP to
WebPresentation proxy. Does your MVP include this feature?
No web features atm, it is included in the 2.0 roadmap though.
Also, I tried to compile the demo, but it gives this error:
ObjectModel.pas(23,3) Error: Only class which are compiled in $M+ mode can be
published
I think I have fixed this annoying issue. Just place $M+/$M- around the
forward class declaration, or include a $M+ on the top of the unit.
Notes: There are known issues with combobox and the F2 shortcut that I
have not workarounded to the LCL interface (VCL interface is nice). They
are registered in the Lazarus tracker. I am refactoring the demo app in
order to use some new features, take a look at the project page now and
then.
--
Joao Morais
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives