Data access framework for delphi - delphi

Is there any framework or code generator for data access in Delphi based on layered architecture?

Delphi has already Multi-Tier / Layered architecture available since early versions. You were never limited to RAD components.
DataSnap is certainly the de-facto standard version of building such applications. See e.g. this article from Embarcadero.
Other Service-Based frameworks written on Delphi are available (DataAbstract,
RemObjects, KBMMw, Midware, WST, Synopse, Spring).
ORM framework are a good way of creating multi-tier separated applications (e.g. InstantObjects, DObject, tiOPF, GFramewok, Bold, Synopse, hcOPF, DelphiORM..). Some of them even allow to build Services above ORM. See for instance our Open source framework.

You can have a look at the various Object Persistence Frameworks out on the market. We have been using tiOPF for some years and are very happy with it. Although it has a very steep learning curve.
There are others available as well, like hcOPF

Related

Difference between framework vs Library vs IDE vs API vs SDK vs Toolkits? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want some examples. I always get confused, so with some examples I might be able to figure it out better.
Also: Is Eclipse an API or IDE?
An IDE is an integrated development environment - a suped-up text editor with additional support for developing (such as forms designers, resource editors, etc), compiling and debugging applications. e.g Eclipse, Visual Studio.
A Library is a chunk of code that you can call from your own code, to help you do things more quickly/easily. For example, a Bitmap Processing library will provide facilities for loading and manipulating bitmap images, saving you having to write all that code for yourself. Typically a library will only offer one area of functionality (processing images or operating on zip files)
An API (application programming interface) is a term meaning the functions/methods in a library that you can call to ask it to do things for you - the interface to the library.
An SDK (software development kit) is a library or group of libraries (often with extra tool applications, data files and sample code) that aid you in developing code that uses a particular system (e.g. extension code for using features of an operating system (Windows SDK), drawing 3D graphics via a particular system (DirectX SDK), writing add-ins to extend other applications (Office SDK), or writing code to make a device like an Arduino or a mobile phone do what you want). An SDK will still usually have a single focus.
A toolkit is like an SDK - it's a group of tools (and often code libraries) that you can use to make it easier to access a device or system... Though perhaps with more focus on providing tools and applications than on just code libraries.
A framework is a big library or group of libraries that provides many services (rather than perhaps only one focussed ability as most libraries/SDKs do). For example, .NET provides an application framework - it makes it easier to use most (if not all) of the disparate services you need (e.g. Windows, graphics, printing, communications, etc) to write a vast range of applications - so one "library" provides support for pretty much everything you need to do. Often a framework supplies a complete base on which you build your own code, rather than you building an application that consumes library code to do parts of its work.
There are of course many examples in the wild that won't exactly match these descriptions though.
The Car Analogy
IDE: The MS Office of Programming. It's where you type your code, plus some added features to make you a happier programmer. (e.g. Eclipse, Netbeans). Car body: It's what you really touch, see and work on.
Library: A library is a collection of functions, often grouped into multiple program files, but packaged into a single archive file. This contains programs created by other folks, so that you don't have to reinvent the wheel. (e.g. junit.jar, log4j.jar). A library generally has a key role, but does all of its work behind the scenes, it doesn't have a GUI. Car's engine.
API: The library publisher's documentation. This is how you should use my library. (e.g. log4j API, junit API). Car's user manual - yes, cars do come with one too!
Kits
What is a kit? It's a collection of many related items that work together to provide a specific service. When someone says medicine kit, you get everything you need for an emergency: plasters, aspirin, gauze and antiseptic, etc.
SDK: McDonald's Happy Meal. You have everything you need (and don't need) boxed neatly: main course, drink, dessert and a bonus toy. An SDK is a bunch of different software components assembled into a package, such that they're "ready-for-action" right out of the box. It often includes multiple libraries and can, but may not necessarily include plugins, API documentation, even an IDE itself. (e.g. iOS Development Kit).
Toolkit: GUI. GUI. GUI. When you hear 'toolkit' in a programming context, it will often refer to a set of libraries intended for GUI development. Since toolkits are UI-centric, they often come with plugins (or standalone IDE's) that provide screen-painting utilities. (e.g. GWT)
Framework: While not the prevalent notion, a framework can be viewed as a kit. It also has a library (or a collection of libraries that work together) that provides a specific coding structure & pattern (thus the word, framework). (e.g. Spring Framework)
Consider Android Development:
IDE: Eclipse etc..
Library: android.app.Activity library (Class with all code)
API: Interface basically all functions with which we call
SDK: The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android
(----tools - DDMS,Emulator ----platforms - Android OS versions, ----platform-tools - ADB, ----API docs)
ToolKit: Could be ADT Bundle
Framework: Big library but more of architecture-oriented
In other words...
IDE
Even notepad is an IDE (not notepad.exe) - Software you write/compile code with is an IDE.
Library
A bunch of code which simplifies functions/methods for quick use.
API
A programming interface for functions/configuration which you work with, its usage is often documented.
SDK
Extras and/or for development/testing purposes.
ToolKit
Tiny apps for quick use, often GUIs.
GUI
Apps with a graphical interface, requires no knowledge of programming unlike APIs.
Framework
Bunch of APIs/huge Library/Snippets wrapped in a namespace/or encapsulated from outer scope for compact handling without conflicts with other code.
MVC
A design pattern separated in Models, Views and Controllers for huge applications. They are not dependent on each other and can be changed/improved/replaced without to take care of other code.
Example:
Car (Model) The object that is being
presented.
Example in IT: A HTML form.
Camera (View) Something that is able to see the object(car).
Example in IT: Browser that renders a website with the form.
Driver (Controller) Someone who drives that car.
Example in IT: Functions which handle form data that's being submitted.
Snippets
Small codes of only a few lines, may not be even complete but worth for a quick share.
Plug-ins
Exclusive functions for specified frameworks/APIs/libraries only.
Add-ons
Additional modules or services for specific GUIs.
SDK represents to software development kit, and IDE represents to integrated development environment. The IDE is the software or the program is used to write, compile, run, and debug such as Xcode. The SDK is the underlying engine of the IDE, includes all the platform's libraries an app needs to access. It's more basic than an IDE because it doesn't usually have graphical tools.

How to do a REST webserver with Delphi as a backend for a big web application?

I read this question but was somehow not satisfied with the answers.
I also quickly read (as suggested in that question) the last chapter of Marco Cantù 2010 Handbook, from which I quote the following (I think I can quote such a short text):
I [Marco Cantù] do have a lot of
investment in server side web and REST
applications written in Delphi, and in
the recent years I've started playing
with and introducing at conferences a
Delphi Web Application REST
Framework119 (that is, DWARF), which
at this time is still not publicly
available... simply because it is too
sketchy and unfinished to be
published. I've seen other ongoing
efforts to clone Rails in Delphi and
offer other REST server architectures.
I think that if you want to build a
very large REST application
architecture you should roll out your
own technology or use one of these
prototypical architectures.
Considering that I own Delphi XE Professional and DataSnap is not in there and I would like to consider to write large applications too according to the above comments it seems DataSnap is not an option.
Is there even a commercial solution for this? I don't want to consider "my own implementation of REST", I would like to create a webserver that uses some of my datamodules where I use the DAC I choose (Devart in this case).
Final note: my goal is to write the backend for a large web application, on the client I would like to use Ext JS 4.0, but I want to do all the client work in javascript, to take full advantage of EXT JS, so basically I need a webserver just for the data and tracking the state, not for serving webpages.
To create your REST services, try our Open Source mORMot project. Now it is a well known and stabilized project, used world wide in production.
You can use any DAC with the current state of the framework by implementing a custom TSQLRestServerStatic class (similar to the TSQLRestServerStaticInMemory class, but calling your DAC): so you'll benefit for the ORM and the JSON RESTful architecture, together with the high-speed http.sys kernel-mode server.
The SQLite3 engine is NOT mandatory with our framework, even if it was designed to work better with it.
If you will start an application from scratch, I think the mORMot is a good option if Delphi is your only option. If you choose datasnap you'll have to live with the problems of performance and stability.
I wrote an article on my blog talking about performance and stability with DataSnap (and mORMot) in large applications, you can see it on the following link:
DataSnap analysis based on Speed & Stability tests
I think you should have a look at kbmMW, there is a way to implement a basic REST server based on an event driven HTTP server.
Check news.components4developers.com news groups, there you will have a lot of documentation.
FireHttp is a high-performance Web server based on Delphi/Object Pascal language. It supports HTTP 1.1, HTTPS (SSL/TLS), WebSocket, GZip, Deflate, IOCP, EPOLL. It adopts multi-process+multi-threading model, has good stability and concurrency performance, and provides SDK source code. Developers can use SDK to quickly build high-performance cross-platform Web applications.

Delphi Applications in RemObject Pascal Scripter

I want to run a Delphi application(With forms vcl, forms, etc) using another application with RemObject Pascal Scripter.
will RemObject Pascal Scripter support all the areas of delphi ,
If so can i include 3rd party VCL
If not what can you recommend me to build interpretable applications with forms and controls
will RemObject Pascal Scripter support all the areas of Delphi
Clearly NO. Haven't used it in a while but "all the areas of delphi" is asking allot. Embarcadero itself isn't setting the bar that high with the "Delphi for Mac". Kylix didn't aim for 100% compatibility either.
can i include 3rd party VCL
Any class can be made available to the scripting engine. But the class itself resides on the compiled Delphi side of things, not on the scripted side.
what can you recommend me to build interpretable applications with forms and controls
Take a look at the "mission statement" for the engine:
"Pascal Script is a widely-used set of components for Delphi that makes it easy to add Pascal-based scripting support to your applications, so that they can extend or control your application with custom scripts"
The author's not positioning it as an scripting engine for application development, but as an engine for extending the functionality of applications. None the less you can probably do a lot with it, it all depends on how you define "interpretable application".
Well, yes and no.
Yes in the sense that you can expose pretty much every aspect of your application to the scripting engine.
No in the sense that "all aspects of Delphi" is too vague a definition to begin with.
I think that what you want is to control, through scripting, some third party control in your form. That is pretty much doable and it can be achieved by using the Unit Importer tool.
Now, there is not much documentation but you can get some useful advice in this SO question.

Language complement for Delphi

If Delphi is the primary language for my development, what is the ideal complement to Delphi.
which should be my next step?
C# for .net and web development
Java
C++ for Know Win32 in depth.
Ruby
Perl
What is your recommendation?
I would recommend HTML, CSS and JavaScript. This sounds like a bit of a strange suggestion when asking for programming languages, but the Web is taking over. Delphi has had the TWebBrowser component since ages, and there are a few alternatives that offer even more features and ways to have HTML rendered onto the forms of your Delphi applications. I have found, when applied in a number of complex situations, it has saved me a lot of work and code.
(To be completely honest, though. I'm suggesting this because I'm trying to blend web-building with Delphi with the xxm project)
My recommendation is C #, but before Getting started with Delphi Prism, the learning curve will be so much easier. Learning a .Net language is going to greatly expand your horizons and types of applications you develop. .Net has a lot of technologies where you can deepen WPF, SilverLigth, WCF.
Delphi Win32 - > Delphi Prism -> C#
Python. It'll take what you've learned in Delphi and allow you to generalize it further.
In addition to Delphi, Embarcadero also sells the RAD C++ development environment.
It uses the same IDE as Delphi so you won't have mix yourself up by learn a new IDE, just a new language.
And you will be able to mix and match Delphi and C++ as you want in the same projects.
In fact, by purchasing (or upgrading to) Embarcadero RAD Studio, you'll get Delphi, C++Builder and Delphi Prism (the .NET tool) all in one.
So C++ seems like the most natural fit and a very logical choice.
And if you want .NET development, don't use C#. Use Delphi Prism.
I will look not for a language, but will think what application technologies to learn and what to develop next. IOW, I will continue with Delphi. Why I have to change it ?
It depends what you want to achieve. I've recently been learning Ruby and Rails (framework) do develop a website and it's been a fabulous learning experience. The wide community of OSS gems and plug-ins means I get a lot more done a lot faster than with Delphi. (And I've also found areas where Delphi beats Ruby too).
Whatever language you choose it should be something with a different 'personality'. What I mean by that is that languages like Deplhi, C++, BASIC and C# all come essentially from the same roots with very similar philosophies. Choose a language like Lisp, Ruby or Haskell which will teach you to think about your coding in a different way.
It just depends on what kind of applications you need/wish to target beside Win32 native ones Delphi targets.
C#: good if you need to use Windows managed features or need asp.net. IMHO, forget Mono.
Java: good if you need to target "managed" non Windows development, especially in some enterprise environments heavily Java based.
C++: if you need to go beyond some Delphi capabilities, and/or target non-Windows platforms natively. Plain C should not be ruled out, can be useful for some advanced develpoment, i.e. kernel development or drivers.
Ruby, Perl, PHP, Python, etc: each have their pro and cons for scripted applications. Ruby and PHP are IMHO better to target web applications when multiplatform is a need, while Perl is a good language to perform heavy text processing in a lot of differnt situations, and Python being a good general purpose tool.
I went from using Delphi pretty much exclusively to using Ruby on Rails, and love it. RoR is to web development what Delphi was to Windows development. It provides a language (Ruby), a framework (Rails) and a whole bunch of code generators to do the heavy lifting for you.
I started a blog some time ago called Delphi to Rails which kind of went through my own experiences making the switch. As much as I enjoyed Delphi, I enjoy Ruby way, way more. It's a strange language at first, but once you've figured out the basics it's super cool, and really fun to program in.

ORM for DELPHI win32

Does anyone know about an ORM or something similar for Delphi Win32.
Marco Cantu is a big believer in InstantObjects:
http://www.instantobjects.org/
Others include DObject:
http://www.macrobject.com/en/dobject/
and tiOPF
http://tiopf.sourceforge.net/Doc/overview/index.shtml
You also might be interested in the G Framework:
http://code.google.com/p/g-framework/
Another Open Source ORM for Delphi 6-XE2, which is JSON based and Client/Server.
Can use its own in memory database layer or embedded SQLite3 database engine:
http://blog.synopse.info/category/Open-Source-Projects/SQLite3-Framework
Edit: A lot of improvements to this active framework, since this question was answered. It is able now to connect to any third-party database, and is changing its name: it is now called the mORMot framework.
There are a few, some of the more tried and tested are...
Bold
TiOPF
And RemObjects also has a schema Mapping technology that is worth investigating
TMS Software is working on an ORM framework for Delphi: TMS Aurelius should be soon released :
TMS Aurelius
EDIT:
It's been already released, official site is http://www.tmssoftware.com/site/aurelius.asp
Another ORM for Delphi, which seems to be in active development, is hcOPF
The project is open source licensed under LGPL/MPL and hosted on SourceForge at http://sourceforge.net/projects/larryhengensopf/.
dorm, “The Delphi ORM” by Daniele Teti, was officially published at ITDevCon, there is an introduction here. It works with PODOs which have no knowledge of the ORM.
New in 2011: DORM - http://code.google.com/p/delphi-orm/. Some documentation can be found on author's blog.
Visit http://code.google.com/p/persiphi/ if your are addicted to Delphi 2010 or upper.
Edit:
Dead link as the owner likely has renounced to opensource it. Nevertheless, his master thesis work in portugese (pt-br) is still available here. A good source of inspiration for those in search of sample using latest bleeding edge features of Delphi (Annotation, Rtti...) in the realm of object persistence.
UPDATE 1:
DevArt has released EntityDAC - An ORM for Delphi with LINQ support!
It works even with D11 (Delphi 2007).
UPDATE 2:
Marshmallow ORM framework by Linas Naginionis.
It has joined join the outstanding Spring4D project as a feature branch as announced here.
To keep abreast of the latest news head to the Marshmallow Google+ thriving Community page.
Dubbed MM ORM Framework by its author, it's a promising one.
Jazz SDK, ORM is a part of the OPF part
http://jazz-sdk.googlecode.com
Here you have one: http://code.google.com/p/delphiorm/
I tried Remobject Data Abstract for 1-2 year in some real world projects.
Some features are good (a very good binary comunication protocol), some other are simply pitfalls (it adds a something of chaotic code and you have to pass dialog by dialog every change you made on the schema).
It's good you define a schema of the model, it's bad you miss much of the power of SQL (es grouping by, a easy to use join, ecc).
I think that it's hard to fit a good ORM on top of the old VCL and TDataSet.
DatAbstact was a try but at the end I rewrited my application in another language because a good ORM and a good framework is a must have for a good application.
VCL is simply too old to fit well with modern concepts of application development.
Anyway i tried InstantObject and Bold, are two good ORM frameworks but not more supported.

Resources