#3 “dorm, the Delphi ORM” bullettin

Uncategorized, dorm No Comments »

A veeery log time after the last dorm bullettin. But, as usual, I was been very busy on some projects (not only dorm) and the time goes by…

However, dorm has been extended, polished and improved over the last few months. Has been used in a couple other projects in my compoany (www.bittime.it).

So, here’s a small list of improvements and some other tips:

- ObjStatus support (more to come)

- TdormSession non-visual component. Check “\samples\DelphiXE3\TdormSession_Sample01\formSample1.dproj”

- dorm is now in Continuous Integration (not for all supported databases, but I’m improving that)

- I’m integrating a JSON/DataSet/ObjectList mapper into dorm to be used in RESTful DataSnap/WebBroker (or not) http servers. More to come.

- Delphi XE3 Support

- Removes SuperObject as external lib. Now dorm uses an internal patched version.

- More demos added (Most noticeably id under “\samples\DelphiXE3\TODOManager\TODOManager.dproj”)

- Added samples using the new Visual LiveBinding feature in Delphi XE3

About the ObjSupport it’s worth to spend some words about it.

Since the beginning, dorm is completely “perisstence ignorant”: In other words, you can persiste what you want, you dont need to inherit from a specific class or implement a specific interface. This is a very powerful feature but make some internal dorm mechanism very complex. But I really WANT to have this feature, so I’ve added another “mode” to work with dorm: ObjStatus.

If dorm engine finds a property nemed “ObjStatus” of a specific type, it’ll use that property to track the object status (Clean, Dirty, Deleted).

In this way, I gained a *LOT* of speed compared to the prior version regarding persistence of complex objects graph.

eg.

procedure DoSomethingOnPersonByID(ID: Integer);
var
  p: TPerson;
begin
	p := Session.Load(ID);
	p.FirstName := 'Daniele';
	p.Car.Model := 'Civic';
	p.Phones.Add(TPhone.Create('555-555-33-22', 'Home'))
	Session.Persist(p); //generates insert, update, delete for related objects too
	p.Free;
end;

As Usual you can find the project code here https://code.google.com/p/delphi-orm/

dorm, “The Delphi ORM” and Spring for Delphi Framework

"The Delphi ORM", Spring4D, dorm 5 Comments »

Great news for all the dorm and Spring4D users!

As you probably know, finally has been announced the official Spring framework for Delphi.

There is a lot of good technology in Spring4D!

So, I’m glad to announce that in a future version (hopefully, the next one) dorm, “The Delphi ORM” will use Spring4D and will become the ORM part of Spring4D.

So, dorm will be part of the Spring4D framework.

More info to come, so stay tuned.

Delphi MVC Web Framework - “Hello World”

Delphi XE, Delphi XE2, Design Patterns, Embarcadero, MVC, RTTI, dorm 6 Comments »

This is the first “Hello World” for my Delphi MVC Web Framework.

program DelphiMVCWebFramework;
  1.  
  2. {$APPTYPE CONSOLE}
  3.  
  4. uses
  5.   System.SysUtils,
  6.   MVCEngine in 'MVCEngine.pas',
  7.   BaseController in 'BaseController.pas';
  8.  
  9. var
  10.   mvc: TWebMVCEngine;
  11. begin
  12.   mvc := TWebMVCEngine.Create;
  13.   mvc.AddRoute('/', procedure(Context: TWebContext)
  14.     begin
  15.       Context.Write('Hello World');
  16.     end).Start(8080);
  17.   ReadLn;
  18.   mvc.Free;
  19. end.

Features list (some of them are in the internal roadmap)

  • Completely MVC
  • Addressable with servername/controllername/actionname?par1&par2
  • Addressable with servername/controllername/actionname/par1/par2
  • Can also use anonymous methods as actions for very simple app (in the sample)
  • Really RESTful (Level 3 of the Richardson Maturity Model)
  • Fully integrable into WebBroker and DataSnap
  • Supports multiple resource rapresentations
  • Completely customizable routing using internal formatting or regex
  • Inspired to ASP.NET, Sinatra, Java Spring MVC, Java Restlet
  • Scriptable views support (Pascal, Razor, Lua)
  • Component based
  • Session support
  • ORM support using dorm
  • Classic TDataSet support
  • State server to support real loadbalancing using reverse proxy
  • Can be deployed as standalone (in the example), ISAPI dll and Windows Service
  • Fully support https
  • More to come…
  • This framework is still under development.

    Are you interested in? :-)

    UPDATE:

    The project is open source and you can fint it here

    https://code.google.com/p/delphimvcframework/

#2 “dorm, the Delphi ORM” bullettin

Uncategorized, dorm 3 Comments »

This is the second post regarding a fast update on the last changes to the dorm project in terms of management and code.

  • Welcome to 2 new contributors: Marco Mottadelli and BraveCobra (this is the full list http://code.google.com/p/delphi-orm/people/list)
  • Added 2 new PersistentStrategy for MSSQLServer based on dbExpress (the 1st use the Embarcadero dbExpress driver, while the 2nd use the DevArt dbExpress driver)
  • Added another PersistentStrategy for MSSQLServer based on ADO (so also Delphi Professional users can use dorm with MSSQLServer)
  • The new mapping strategy is under development. There will be “3 levels” of mapping: Config File, RTTI Attributes and “Conventions Over Configuration” (CoC) (do you wanna check the code in dev branch? Click here)
  • Added more unittests
  • Roadmap updated
  • Introduction to dorm, now is a PDF document
  • The config file has been splitted in “Persistence” and “Mapping” for a more flexible configuration
  • Added packages (Thank you BraveCobra)
  • Added MappingCreator. Now you can create the mapping file using an existent database.
  • IWrapperList (a duck typed list) now is used EVERYWHERE! You can use whatever list from whatever library you want to use. The list must have only a specific methods named as following: Add, Clear, GetElement/GetItem, Count
  • Added FillList methods
There are plenty of new features still to come. Stay tuned!

dorm, “The Delphi ORM”, officially published at ITDevCon

Projects, Uncategorized, dorm 11 Comments »

As all the attendees have seen, at the last ITDevCon, I’ve officially published dorm as an OpenSource project.

dorm, The Delphi ORM

dorm, The Delphi ORM

You can find the project on google code: http://code.google.com/p/delphi-orm/

An introduction to dorm is available on google docs.

dorm begins as a my personal project more than one year ago, and now is sponsored by bitTime Software that offers custom development, consultancy, mentoring and so on.

Why dorm?

These are my personal reasons of because I’ve started to write dorm:
I WANT an ORM for Delphi… but:
I dont want (or I cant) change my database
I want persistence ignorance
I want to access to the «metal»
I want to persist PODO
I don’t hate SQL, but I know that 90% of it is boilerplate and errors prone

First example

Insert and retrieve object with dorm

Insert and retrieve object with dorm

You can persist anything you want.
bitTime actively use dorm, so it’s continuosly updated and evolved.

Repeat, you can find the project on google code and an introduction to dorm is available on google docs.

Let me know what do you think about.

Do you need an ORM like dorm in Delphi?

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in