Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What patterns to use to build layers for delphi win 32 application

I want to develop mysql database application using dbexpress to develop from scratch or work with existing databases. To create reusable layers what patterns-components should I use. I want the app to be scalable to n-tier easily. Tried google search for ready frameworks but I found nothing much informative (some lack documentation, some lack examples).

Something in the veins of famous java frameworks i.batis or hibernate would be useful. I'm familiar using such a framework in PHP to develop xml defined business objects. I tried to convert it to Delphi but it is much of a work.(Abstraction with delphi strict typing makes everything hard for my exprerience level.)

Also ruby on rails activerecord-like implementation may be useful.

I could never be clear about trashing dbaware components or not.

I tried to implement some design patterns to separate layers (data access/connection), (business objects), (gui), but with no success. What I try to achieve is to mimic lego (I can use any database engine , any delphi database technology(bde, ado etc.. dbexpress is a must, others are optional). Also I may use xml (mybase or native), text files (csv-like, legacy parsing code)

I may need single tier, client/server and n-tier.

Also I may need some kind of web service implementation (the client side may be any technology apart from delphi executable , so I think generating xml, wsdl easily is necessary)

The data access layer is the most important part. It must be flexible because other frameworks will be developed upon it (user authentication, app configuration etc...).

  • I may challenge to develop my own simple framework (I don't know what to follow: database adapter pattern, db connection factory, mappers, data access objects etc..)
  • I can use an existing one (instantobjects not applicable. not work with existing db schema). Some of the others I tried lack dbexpress support or I could not understand the configuration.
like image 634
user114285 Avatar asked May 29 '09 13:05

user114285


3 Answers

Mohammed's response covers the n-Tier part of your question. The part about being similar to i.batis or hibernate pushes you towards object-oriented persistence frameworks like tiOPF which are a somewhat of a different beast.

Here is the list of persistence frameworks for Delphi that I am aware of at this time. I believe CG also did some sort of persistence demo at Delphi Live so there might be something else on the horizon.

  • InstantObjects ** Delphi 2009/2010 support is now in SVN
  • PressObjects SDK
  • tiOPF
  • Jazz-SDK
  • DObject
  • Infra
  • EOS
  • g-framework
  • Easy MVC
  • Delphi Persistent Object
  • hcOPF -- Just spotted this one 9/2009
  • Bold for Delphi - Last sighted somewhere near ECO ;)

FWIW - I have used InstantObjects (IO) in several commercial products (albeit in a non-standard way) and am working on a port to Delphi 2009. PressObjects is by one of the IO developers and I recently joined that project since it looks interesting. I would not discount frameworks like tiOPF, Jazz etc since YMMV. I would be doing these frameworks a disservice by commenting since I have not used them beyond simple test cases.

like image 57
David Taylor Avatar answered Nov 03 '22 01:11

David Taylor


If you would like to build Delphi n-Tiers solutions, that be access from diffrent clients (Non Delphi), you have these options:

  1. RemObjects' DataAbstrct.
  2. kbmMW
  3. MIDAS/DataSnap built in Delphi
like image 23
Mohammed Nasman Avatar answered Nov 03 '22 01:11

Mohammed Nasman


At my company we use the tiOPF framework to achieve this. It uses several patterns to separate the GUI from the object model. It includes a database layer to connect to almost any database or text file.

To link the non-data-aware controls to the model there are several mediators available. With some more experience you canwrite your own mediators. We have written several mediators to link to the DevExpress controls, for instance.

The documentation of concepts behind the framework is good. For all other questions there is a newsgroup that is frequently visited by all core developers.

Have a look at the tiOPF website!

like image 33
Birger Avatar answered Nov 03 '22 00:11

Birger