Jump to content

Recommended Posts

Posted

Hi folks,

 

I try to set AutoEdit property of one or more TDatasource located on a TUniFrame. I tryed following code below but ControlCount is always 0.

procedure TMyFrame.UniFrameCreate(Sender: TObject);
var
  i: integer;
begin

  for I := 0 to self.ControlCount -1 do begin
    if TComponent( self.Controls[I] ) is TDatasource then begin
      TDatasource( self.Controls[I] ).AutoEdit := UniServerModule.AUTOEDIT;
    end;
  end;

end;


Any ideas?

Posted

I moved all TDatasource components to the TDatamodule unit. Now i can do it like this:

  for I := 0 to self.ComponentCount -1 do begin
    if self.Components[I] is TDatasource then begin
      TDatasource( self.Components[I] ).AutoEdit := UniServerModule.AUTOEDIT;
    end;
  end;

That seems to work.

What is the right approach to locate a TDatasource on a Unigui project? Till now i placed the TDatasource on a TUniFrom or TUniFrame and the database components (Connection, Querys) on TUniMainModule or a TDatamodule.

 

Cheers

 

Jean-Marc

Posted

I think the reason why the vast majority of uniGuiers place teh datasources in the forms is just scalability,

For me their places are the DataModule.

but I think saving some bytes won´t pay the price of coding maintanance,and its up to you to close your

datasets when they´re not needed anymore.

And scalability can be reached by using load balancing.

Scalability was once a big problem in uniGui,but the components have been rewritten and Delphi 64 bits

have pushed the limits.

How many simultaneous users are your application going to have?

People soemtimes scare about a scalability that will never happen,ERP systems should never be multi-tenant.

Posted

In my case here there TDatasource.OnStateChange is heavely used to enable/disable visual components. That's the reason why it is located on the TuniFrame instead of the TUniMainmodule or TDataModule.

 

Or is there a proper way to set Properties of  visual unigui controls on a form from TUniMainmodule?

Posted

uniGui is server centric,its no more than a Delphi DLL version ,so I don´t think it is anything different than you did in 

a traditional Delphi system.

are you using ClientDatasets,If don´t you probably should.

Or the FireDac Memtables.

Posted

Kiener look at this one:

 

http://forums.unigui.com/index.php?/topic/290-datasources-in-uniframes/  this message is very old,so something could have changed.

 

I don´t use frames only forms,thats why i created JAUD(based on perjanbr desktop3),I would like to know the advantages

of using frames,because probably there are,the majority of uniGuiers use them.

If its just scalability its a question of design,for me scalability is a non functional requirement,that can be achieved by load balancing,and

t never sacrifice user experience,and almost never code maintanability.

So I´m really evaluating if i´m going to use frames or forms.

But for those who want to migrate their applications using a parser/importer ,probably

things like JAUD will be an easier path.

But it is a difficult subject,when change your design or not to meet non-fucntional requirements,I myself hate ORM I think they kill scalability,

user experience in order to gain code maintanability(at least some people think it is).

 

Marcello

 

Update:I decided to use frames for the details in master detail relationships(those that the user will sometimes be interested,sometimes not),and

for all content that will be in the page,but taht can be showed only after a user clicks in a button.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...