Building XpoLinq

by Miha Markič 6. January 2006 10:53

Developer Express recently released first beta version of their XPO2 ORM product to their subscribers (currently there are also betas of both XtraCharts and XtraLayout - all of these betas look really good). Since I've already dived into Linq/DLinq world I soon missed Linq features for doing queries. Thus I couldn't resist and started implementing it myself - hence the XpoLinq project is born. Here is an example of syntax:

RhCollection
 address = from a in addresses where a.City == "Nova Gorica" select a;
 
Note that Linq is used only for creating select expressions while behind the scenes runs XPO2.
 
XpoLinq syntax and has few benefits over existing Xpo CriteriaOperator syntax:
- intellisense support (a.City)
- code checking during compile time
- integrates with Linq (you can mix queries between Xml, DLinq, XLinq and any other Linq compliant subset)
 
I find all of these points above extremely useful features that should be present asap in any product that does queries. Perhaps the only problem is that Linq is still far away to being released (but it is very functional right now) and using its features for short time projects might be risky. Anyway, whether I continue work on XpoLinq is unknown depending on several factors: my time, DevExpress implementing it, my curiosity, etc. Regardless if my XpoLinq lives or not it has been certainly an interesting Linq learning experience.


Retweet

Tags:

DevExpress | .net

Comments

5/20/2006 6:50:56 PM #

Renaud Bompuis

Hi Miha,
I'm curious about your XpoLink implementation.
Do you have anything concrete that is usable?
I'm using XPO 6.1 and am just exploring any enhancements that might prove useful.

Thank you,

Renaud

Renaud Bompuis | Reply

5/22/2006 11:26:19 AM #

Miha Markic

Hi Renaud,

I was just experimenting with Linq stuff at that time. I managed (very quickly) to enable simple scenarios and then left the thing as it was because:
a) Mainly because Linq is in early phase (no go live on the horizon)
b) it is the job for DX to implement it Smile as I didn't want to vaste too much time on stuff DX has to implement

Miha Markic | Reply

6/29/2006 10:04:11 PM #

Dan Vanderboom

Miha, you've read my mind!  Smile  Fascinating and very promising work you're doing.  I'm definitely on board with this direction for XPO.  Now whether it becomes an extension to XPO or DevExpress incorporate/buy it from you, it has obvious value.  Have you run across any show-stopping limitations due to Linq's early state or design philosophy?  I was skeptical that it could be used merely for creating select expressions, but I'm quite happy to hear this is possible.

Do you have any more information on the status of this project?  Perhaps I could offer my assistance if you think there'd be any value to it, whether code or someone to bounce ideas off.

Please keep this project alive!

Dan Vanderboom | Reply

6/29/2006 10:05:54 PM #

Dan Vanderboom

BTW, I notice you use your own collection type to store the results.  Is XPCollection no longer possible with XpoLinq?

What happens to XPView in this world?

Dan Vanderboom | Reply

6/30/2006 1:17:08 PM #

Miha Markic

Hi Dan,

About status of the project: there is not much to say about it. Perhaps the worst problem is that Linq RTM is far far away in the future. And no, Linq is very functional and I don't foresee any technical problem implementing XpoLinq right now - it is just for the above reason I didn't invest much time into the thing. The second reason would be that DX will sooner or later have to build it - everybody (ORMs) will have to.
Regarding XPCollection and XPView: there are no limitiations to use them. I use RhCollection for other reasons.

But wait. There is another way to have strong typed elegant query language right now (some competitive ORMs have it). You would need a code generator (which XPO doesn't have) and a proper bunch of templates (if you don't want to type like mad)

Miha Markic | Reply

6/30/2006 5:13:48 PM #

Dan Vanderboom

Is it something you would mind sharing with me to play around with?  Has DevExpress not expressed interest yet?  A year will be here before we know it (or they'll issue a Go Live license earlier), and if we're poised to take full advantage right out of the gate, instead of STARTING our implementation at that time, we'll be in a much better position.  Some valuable lessons could be learned between now and then about the pitfalls and limitations, or is it just so easy there's nothing to it?

Dan Vanderboom | Reply

6/30/2006 11:57:10 PM #

Miha Markic

Is it something you would mind sharing with me to play around with?

It is a public knowledge: you have to abuse operator overloading.

  Has DevExpress not expressed interest yet?

My opinion? I would say no. If DX would ship a code generator or just templates for one of the generators out there (such as CodeSmith) it would be pretty trivial to have such a query language. But since they don't I assume they are not that interested (take note that this is just my opinion). Actually i am writting an article about XPO weak points (being a good ORM doesn't mean that it doesn't have weak points) - among the points is lack of code generator.

Miha Markic | Reply

7/3/2006 6:43:19 PM #

Dan Vanderboom

No doubt that every ORM has weakpoints, but I considered the lack of code generation in XPO to be a strength.  I don't want code bloat, thousands of lines of code that will have to get updated/regenerated every time I make a change to domain classes.  But is this really necessary to support Linq?

What's needed is an ORM side-by-side feature comparison.

Dan Vanderboom | Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Miha Markič

About me
Righthand
 
Microsoft MVP
 
Developer Express' DXSquad
INETA Country Leader for Slovenia
INETA Country Leader for Slovenia

Slovene Developer Users Group Lead
Friends of Red-Gate
LLBLGenPro Partner

Miha currently works as a free lance consultant and software developer specialized in .net area.
He graduated in Computer and information science at the University of Ljubljana, Slovenia. He has accumulated experience in various programming languages such as Java, Visual Basic 3-6 (MCP), Visual C++, Delphi, C# and VB.Net through years.
He has experience in practically all (technical) stages of project development, including planning, framework development, user interface, business processes, as well as testing and documenting. He has worked on big and small projects in Slovenia and abroad (e.g. participated in completing level 3 IS for the Nucor steel plant, Hertford, USA).
Currently he enjoys programming in .net environment using C#. Since 2000 he has been active in Developer Express' DX Squad and has been ECDL trainer and tester. He also gives lectures on conferences and other events in Slovenia.

Shortcuts

Add to Technorati Favorites

Social networking

Most comments

Electrolux Ergorapido Electrolux Ergorapido
1 comments
pr Puerto Rico
Holiday Travel Deals Holiday Travel Deals
1 comments
us United States
Marko Marko
1 comments
si Slovenia
olivier olivier
1 comments
fr France

Google friends

Recent Comments

Comment RSS