PDA

View Full Version : Application 3-tiers (multi layers)



estanisgeyer
13th February 2009, 16:09
Hi friends,

I'm developing an application that supports the database Firebird. QT4 can make an application with multi-layers (3 layers or 3 tiers). How would the return of data from a QTableView? I have little doubt, is the QtSql module supports multi tiers? Examples are welcome.

Thanks,

Marcelo E. Geyer

caduel
13th February 2009, 17:01
first: what constitutes a layer is kind of abstract and subject to personal interpretation.

A QTableView displays data of a "model". These models can be layered (through proxy models). How the data gets into the "base" model, is up to you. You might use a QSqlTableModel, or you might communicate with the db through custom classes (lots of room for layers there, too):
How many models (or other layers) you put between the db and your view, is up to you.

I suggest you describe what you plan to achieve, and then we can suggest a (or critique your) design for that goal.
The number of layers is rather immaterial imo. Just try to think of "separation of concerns", i.e. separate db access logic from user interface logic etc and you should be fine.

estanisgeyer
13th February 2009, 17:28
Hi,

The idea is to improve the performance especially when access to the database is through the internet and try to separate the interface of the client to the database, as you mentioned.
Thought to start porting to 3 layers, following this structure:

Database <---> App Server <---> LAN/WAN/Others <---> App client

Thanks,

Marcelo E. Geyer