Hi All,

I am currently trying to understand the transport of variables in the midware functions.

I create a serverobject like in 'my first server'. This idea works just fine.
Now I went a step further, and probably I am looking in the wrong spot..
I created a function for looking up a variable in a database in my server-application, so the query is not in the server-object but in the main-form application (see small snippet below). Now I want to call that query-function from the serverobject I created, however I am not able to call that function.. The function I created is public, or private, but seems not to get availlable in the serverobject. Do I need to do something special to transfer this function or data to the main-screen and get the result back? I have been looking in the demo, but in some way I get lost in the way it transfers this data..


This is the function declared in the main-unit/form :
function getsat ( sat : string):string;
var
 sat : string;
begin
  with service2.satqry do
   begin
     sql.Clear;
sql.Text := 'Select * from `satellite` where `option` = ''' + sat + '''';
     sql.open;
   end;
end;

Any idea what I need to do?

Best regards,

Ruud Kerstens

-----Oorspronkelijk bericht----- From: Ruud Kerstens
Sent: Sunday, January 23, 2011 6:36 PM
To: ICS support mailing
Subject: Re: [twsocket] Midware create serverobject 'problem'.

Hi Francois,

Well, you caught me there, as I was thinking the Tier-2 way as well. Now
after reading your email I fully understand the idea behind the Midware.
This will make life much easier for me as you can create as many different
clients as you like, all just ask for items they need. The good thing is
indeed that I don't care what the 'server' does, as long as it gets what it
needs.
What is perfect as well, is that in that case only server needs to be
changed when things need to alter, and the client does not really need
updating (unless new items to be displayed etc).

Thank you for the reply, and explanation,

Best regards,

Ruud

-----Oorspronkelijk bericht----- From: Francois PIETTE
Sent: Sunday, January 23, 2011 8:59 AM
To: ICS support mailing
Subject: Re: [twsocket] Midware create serverobject 'problem'.

Got the first server working now, so that is fine.

:-)

Despite of the demo's i see for ADO and BDE, i am using another database (absolutedatabase :
www.componentace.com), which is a BDE replacement.
Is this just as easy to connect as the examples that are included with Midware,
or do i need to create my own 'BDE' serverobject?

Yes, it is just as easy with any database component. Midware at server side
is simply not concerned by the component you use. Use whatever you like !
And client side is completely independent of what you use at server side.

Please not that many developer are falling in a frequent design error when
dealing with multitier: they are transporting SQL request from client to
server. This works of course but this is really not the design for 3-tier
programming. Transporting SQL request is simple 2-tier (classical
client/server).

To really befenit from 3-Tier architecture, you have to think at a higher
level. The client do not "know" anything about database, storage and similar
topics. It only "knows" about high level concepts of curse much of these
high level concept can be expressed as SQL request, but don't do it at
client side ! All SQL must go to server side. The client must not know the
database, the tables, fields and indexes ! It only knows things such as
"GetClient" and how to pass parameters which refines the search, it knows
about "SaveDocument" and send the document. The server know where and how
the documents are stored and what has to be verifyed to accept a document.

Best regards,
--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to