Recent

Author Topic: Contemplating transitioning to Lazarus for Client/Server development, "Can I..."  (Read 4150 times)

mdlueck

  • Jr. Member
  • **
  • Posts: 92
    • Lueck Data Systems
Greetings,

Anticipating "next projects", now is a good time to look into using different tools than MS Access.

I really researched how to use Access as best as possible in a Client/Server environment. I am hoping what I came up with for Access may be translated to the next tool I select.

I picked up the design point that in Lazarus, widget sets are double class wrapped. Similarly, I double class wrapped database access.

Form UI <---> Validation Class <---> DB Class <---> SQL DB

The DB Classes exist one per logical table collection. For example, for this ERP application there is a parts list. Several look-up tables support the parts list capability. I rolled all of that into a Parts DB Class. Yes, those individual pick lists had their own editor DB classes, however pick lists are read only when out in the main application interface dealing with the parts table. So this DB Class for the Parts table knows how to Insert / Update / SelectByID / SelectByPN and so on. As much as possible I utilized ADO.Command / ADO.Parameter objects for my calls to the SQL DB. All table columns are exposed as properties of the DB Class object.

The Validation Class performs mapping between the DB Class object and the Form UI controls. It also performs data validation. If invalid data is found on the form, the field is marked in red background and an error box popped.

1) Is such possible to achieve with the Lazarus live data access controls?

2) Suspecting it is not, just how many things am I looking at fabricating on my own instead of relying on the live data access controls? Like, obviously I am not setting out to develop my own set of UI controls. So where would the line be between using stock Lazarus components and me having to develop my own code from scratch.

3) Since Lazarus is not a desktop database product, I suspect I need some sort of in-memory table to collect records resulting from a SELECT Stored Procedure so that the data could be displayed on a form. Correct? What solution would be suggested for this? (I am thinking for a SP returning multiple rows, and that is to be displayed in a read-only grid control UI.)

4) Oh, and I seem to recall several DB components from last time I looked at Lazarus. Could someone suggest which type to consider first that has syntax similar to ADO.Command / ADO.Parameter objects as far as encapsulating the data separate from the SQL. (Prepared SQL statements) At least in the Access / VBA camp, it was very common to see people issuing bare SQL with the data mixed into the SQL.

Thank you.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
From a quick reading, I suppose you are talking about ORM/OPF. In case yes:
Quote
1) Is such possible to achieve with the Lazarus live data access controls?
Sure, we have some plenty options, notably tiOPF. There are also Greyhound (it's not pure ORM, but has ORMish features including validation), ghORM (true ORM on top of Greyhound, written by me, not complete yet) and some other (those Delphi ones should eventually be portable to FPC/Lazarus). The tiOPF website has several documents regarding this and the appropriate design pattern for desktop GUI apps (MGM).
Quote
2) Suspecting it is not, just how many things am I looking at fabricating on my own instead of relying on the live data access controls? Like, obviously I am not setting out to develop my own set of UI controls. So where would the line be between using stock Lazarus components and me having to develop my own code from scratch.
Depends on your knowledge and the base code you are taking from.

mdlueck

  • Jr. Member
  • **
  • Posts: 92
    • Lueck Data Systems
From a quick reading, I suppose you are talking about ORM/OPF. In case yes:
Quote
1) Is such possible to achieve with the Lazarus live data access controls?

When I looked at Lazarus a couple of years ago, when I was starting the development of the ERP / Business Intelligence application, I remember it being stated that one could only get so fancy/complex with the Lazarus live data controls, then at some point as things got more complex, one had to set those training wheels aside to code differently.

At that point I had not yet worked out the best way to use Access in a Client/Server environment... leveraging all Stored Procedures, ADO.Command / ADO.Parameter objects, etc... what I ended up with was "Ain't your mama's Access" which actaually performs quite nicely.

Depends on your knowledge and the base code you are taking from.

That did not answer my question of how much of what I am talking about I can accomplish with Lazarus live data access controls and how much I must do manually.

And I forgot to mention, I am looking for the primary development platform to be Linux, targeting at least Linux and Windows for deployment platforms. So checking that the components you were pointing me towards are available on both platforms.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

 

TinyPortal © 2005-2018