[ARTICLE] ActiveObjects, an interesting ORM!

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

[ARTICLE] ActiveObjects, an interesting ORM!

Postby Lapo » 14 Sep 2007, 20:27

I've noticed that a good number of developers are using SQL code in their extension code, so I'd like to point them to an article about an interesting Java ORM (Object Relational Mapping) called ActiveObjects.

While you may have already heard/worked with more famous ORMs such as Hibernate and IBatis you may also have noticed how much configuration code must be written before getting anything done :(

Well, it seems that finally the concepts of simplicity and ease of use have also landed in the Java world of ORMS.

Since SmartFoxServer provides quick prototyping and development with Python and Actionscript it's quite exciting to think about how simple would be database access with ActiveObjects

Here's a very nice article to get you started

The project homepage
cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Luc
Posts: 18
Joined: 17 Jun 2007, 21:05

Postby Luc » 18 Sep 2007, 12:15

Have you used this on a project? It looks very appealing, but their webpage seems to suggest it is still very unstable and for testing purposes only.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Sep 2007, 16:31

Not yet, but we plan to start testing soon.
As you mentioned the project is still in its first releases and documentation is far from those found with Hibernate... but maybe that's also because Hibernate is way more complicated :)

I will post here our findings as soon as we find the time to test it a little.
If you precede us, let us know :)
Lapo

--

gotoAndPlay()

...addicted to flash games
Boing
Posts: 59
Joined: 11 Apr 2008, 14:57

Postby Boing » 22 Oct 2008, 15:22

I'm thinking about using some ORM mechanism too.
The active objects project sounds interesting but not too active... have you tried it yet, Lapo?
Can somebody who has used ORM technology (hibernate, DataNucleus, whatever) within SFS give some advice?
nig3d
Posts: 164
Joined: 02 Jul 2008, 09:42

Postby nig3d » 22 Oct 2008, 15:39

What about simple DAO patterns?
Boing
Posts: 59
Joined: 11 Apr 2008, 14:57

Smartfox and ORM

Postby Boing » 23 Oct 2008, 06:28

Thanks for the reply, nig3d.
DAO patterns seem to be a nice and clean way to abstract the data access but on the other hand increase development time.
Since our main idea behind using an ORM lib was to reduce programming cost, DAO patterns do not seem to be the appropriate solution for us.
User avatar
darnpunk
Posts: 229
Joined: 22 Jun 2007, 02:58
Location: SG

Postby darnpunk » 23 Mar 2009, 14:00

Hi Lapo,

Any case studies with ActiveObjects? Pretty interested in this ORM although I havent had experience with any ORMs at all. I am wondering, will there be performance impact or slowdowns if you use ORMs to access your database?

I mean instead of calling it directly, you have to go through the ORMs. I would imagine there may be some performance hit which may affect in busy periods. Correct me if I am wrong.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 24 Mar 2009, 06:15

I only have direct experience with Hibernate, so I can't say about ActiveObjects. And yes you pay a performance price in exchange for the ability to avoid sql and work at a higher level.
The performance cost depend a lot on the db structure, query frequency, query complexity, and more variables...
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
levancho
Posts: 71
Joined: 27 Jun 2011, 16:03

Postby levancho » 30 Aug 2011, 16:00

Little late reply,but still worth mentioning :)

latest version of Ibatis (3.x) is pretty simple, they have finally managed to make it simple, you can annotate interface method with SQL and then everything gets done "automagically" of course this implies of using spring to do rest of the magic, but overall its pretty simple setup.


magic interface methods look something like this:

Code: Select all

   @Delete("DELETE from users where id=#{userid}")
            public void deleteUserForId(@Param("userid") Integer id);


and then you can invoke that method from your higher layer code, directly and it just works.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 68 guests