Re-Linq source and contributions

79 views
Skip to first unread message

Guillaume Lecomte

unread,
Feb 2, 2014, 11:27:24 AM2/2/14
to re-mot...@googlegroups.com
Hi, 

I recently downloaded re-linq and played a bit with it to see if I could use it to build a "semi-dynamic" data access layer: 
a part of the schema is defined at compile time like classic Linq-to-SQL but some tables/columns can be added/accessed at runtime.

I had some success generating runtime types to inject the additional columns and retrieve them with relinq but I have a problem with
IlGenerated "anonymous types" (for runtime Select projections), the SqlBackend do not implements MemberInitExpression (classic C# anonymous types use a NewExpression).
So I downloaded the source and implemented MemberInitExpression, got it to work, 
but it's not perfect, I had to comment out some Exception code and 2 unit tests are failing because of that.

It's what bring me to the question: Is there a process to contribute to relinq?
A github repo would really be nice, I could just make a branch and you could merge it when it's done (and help me fix my little problem easilly).
I'm sure you would get a bit more visiblity too.

PS: congrats for relinq source code, it's one of the best written/tested project I've seen, a pleasure to work in

Michael Ketting

unread,
Feb 3, 2014, 2:48:06 AM2/3/14
to re-mot...@googlegroups.com
Hello Guillaume!

Thanks for taking the time to dig into re-linq and the PS. This sort of thing is always great to hear!

As for contributing: Well, we've kind of followed a public-demand kind of policy with that one, so once people want to contribute we'll hammer out the details. But the baseline comes down to: please, send us a patch! It will get reviewed and when the design works and all the tests are there we'll be happy to incorporate it.

As you've noticed, re-linq is presently hosted in an SVN repository, together with the rest of re-motion, so github's not an option for us ATM, but switching to a DVCS has been discussed in the past, specifically for the reasons you've mentioned.

Best regards, Michael

Guillaume Lecomte

unread,
Feb 5, 2014, 2:27:22 PM2/5/14
to re-mot...@googlegroups.com
Hi, 

I rolled my changes for MemberInitExpression with Assigment bindings into the patch I attached, you'll probably need to change the Exception handling code and add some unit tests.
Glad to ear you consider a DVCS, I can't wait to follow more closely the project.

Guillaume
0001-Implement-MemberInitExpression-limited-to-Assignment.patch

Michael Ketting

unread,
Feb 10, 2014, 10:01:59 AM2/10/14
to re-mot...@googlegroups.com

Hello Guillaume!

Sorry it took me a couple of days longer than I'd hoped to get back to you. As far as the library functionality is concerned, the feature is almost complete. What's missing is an adaption of SqlContextExpressionVisitor. Here, you need to apply the value context to the assignments, like it's done in VisitNewExpression. This takes care of Boolean-support etc, e.g. when evaluating a condition while doing the assignment. Please see also the feature issue in our Jira: https://www.re-motion.org/jira/browse/RM-3306 I've checked this with our tracked features and RM-3306 covers just the member-init within the outer select expression. There's also a subquery and a comparison aspect to the MemberInitExpression that are not part of your contribution, which is fine since we can isolate the scope nicely.

For code style, please change the NotImplementedException to a NotSupportedException. The difference here is that not-implemented only refers to features that lack implementation while not-supported is used when the specific functionality is not possible. Also, please use long variable names instead of abbreviations (e.g. with "expression" instead of "exp") outside of lambda expressions and spaces in front of parameterized method calls and casts. That way, the code uniformity remains preserved. Public and protected method calls require parameter checks, please add them. (Explicit test cases for run of the mill checks like not-null are not required).

Please refactor the check for supported bindings into a utility-method (and add a separate test for this) to prevent code duplication.

We also need unit tests for the adapted/new classes, structured in typical test-first approach, i.e. a test for the main path and each special case in the code.

I see that you've already found our integration tests :) One part of the C# and VB.NET integration tests contain the 101 Linq samples. I've added an explicit test for MemberInitExpressions with all the cases we need to support during MemberInit since we've not had a setup for those yet (r29118). What we also need are integration tests for lists (WithMemberInitExpression_AndCollectionValue_InOuterMostLevel) and nested init expressions (WithMemberInitExpression_AndNestedMemberInitExpressionValue_InOuterMostLevel).

Side note: We do have additional integration tests for the SQL backend within our O/R-mapper, but are thinking of moving them over to re-linq at some future time.

Last but not least, we need you to please fill out the Contributor Assignment Agreement (https://www.re-motion.org/web/?page_id=82) .

Thanks for contributing!

Best regards, Michael

Michael Ketting

unread,
Feb 10, 2014, 11:00:08 AM2/10/14
to re-mot...@googlegroups.com
The contribution practices are now also documented on our CodePlex site:
https://relinq.codeplex.com/wikipage?title=Contributing%20to%20re-linq
Thanks for getting the ball rolling!

Best regards, Michael

Guillaume Lecomte

unread,
Mar 29, 2014, 6:13:21 PM3/29/14
to re-mot...@googlegroups.com
Thanks, 

I'd like to finish the feature but I have troubles getting the lastest source with "git svn",
I get that error at the end of the command:

fatal: refs/remotes/trunk: not a valid SHA1
update-ref HEAD refs/remotes/trunk: command returned error: 128

Any idea what's going on?

Michael Ketting

unread,
Mar 31, 2014, 2:02:57 AM3/31/14
to re-mot...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages