Joao Morais wrote:
> Al Boldi wrote:
> > 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;

Looks neat.  Can you give a more complete example based on a simple TPerson 
db with 2 fields: id, name

> > 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.

Well, your demo phone app doesn't look so simple.  Maybe you can just create 
a mini app with just 2 fields: id name , with dbnav/edit-buttons.

> > 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.

Great.  Keep us posted.

> > 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.

Still doesn't work.  But I just moved the default published fields into 
public and it compiles and runs, but then I get this dialog:

        No service 'Messages' assigned or registered

So I turn {$DEFINE UsePressOPF} on and then I get this 
../Press/Source/Brokers/PressSQLdbBroker.pas(48,16) Error: Identifier not 
found "TSQLConnector"

> 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.


Thanks!

--
Al

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to