ANN: DXCore XPO plugin 1.2.0.1

07 August 2008

Version 1.2.0.1 of the XPO plugin is now available, compiled against DXCore 3.0.8. Please download it here:

CR_XPOFieldSync-1.2.0.1.zip (20489 bytes)

As always, if you're not familiar with the purpose of the XPO plugin, please read this description of the "Simplified Criteria Syntax" feature.

I have recently mentioned to a few of you, through the Support Center, that I was considering retiring the plugin soon. LINQ has been mentioned several times as the query technology of choice, and I would like to make that point again. The "Simplified Criteria Syntax" feature in XPO was originally introduced as a way to write queries more easily, and specifically with the fact in mind that LINQ was at that time still about two years away from general availability. Now that LINQ is available and well supported in XPO, we do recommend you use it to write queries in code. Since LINQ is a very general-purpose technology, there will be cases where our own criteria system can do things that can't be represented in a LINQ expression. But for the vast majority of cases, there's no better way of writing queries in code today.

Nevertheless I've changed my mind about deprecating the XPO plugin. The reason is that I've learned how many other things, apart from querying, users do with the plugin and the code it creates. Generally speaking, having a reference to a certain field in a persistent class - which is what the XPO plugin creates - is very useful in a variety of cases that don't have to do directly with querying, and so cannot be covered by LINQ. So for now, I will keep supporting the XPO plugin as well as time allows.

For version 1.2.x, I have restructured certain things about the way the plugin works. In prior versions, the plugin was trying to be rather clever about the code generation/modification process, for instance by removing only those elements that weren't needed anymore after a code change, or inserting only those that were new. This has proved extremely tricky over time with regard to the interaction with the DXCore and the code parsing it does, since the plugin needs to know exactly what the current state of the code is while it executes several deletions and insertions, and the developer possibly keeps on typing and making more changes. The major structural change in this version is that the plugin always creates the entire code block and either inserts it or replaces the previous version with it. This does come with its own problems - see below -, but it makes things much more predictable and less dependent on details of the inner workings of the DXCore.

Here's a summary list of changes in this version:

  • Restructured lots of the plugin to solve some long-standing problems
  • Manual execution of sync is now possible - configure a key binding for the SyncXPOClass action
  • Fixed B95475 - (a part of the) Fields class wasn't being created
  • Fixed B93229 - certain persistent property types weren't recognized correctly
  • Fixed a problem where the code region was created in the wrong place, or not at all, when using nested persistent classes
  • Fixed CB56295 - handling of NonPersistent on base classes
  • Implemented CS49600 - optional inclusion of NonPersistent members - see option dialog
  • Implemented AS13477 - toggle automatic sync using a key binding - configure a key binding to the ToggleXPOAutoSync action
  • The "Global Off" option has been replaced by the "Automatic Sync" option, which is Off by default

Note the last entry, please. If you like to use automatic synchronization, you have to go to the options dialog after installation of the latest version and switch it on. By default, the plugin doesn't use automatic sync anymore. From my own experience during testing, the manual sync is quite comfortable, although of course there's a risk of forgetting to sync.

There are currently three known problems with this plugin version:

  • The forever outstanding issue CB8627. Unfortunately, I still don't have a solution to this. The DXCore parser is apparently unable to tell me if there's a critical structural problem in the source code I'm looking at, and so the sync process creates code in the wrong place, or doesn't recognize that there's already a region it should replace. I'm still hoping to be able to fix this problem eventually. In this version, one possible workaround is to use manual sync - just make sure your project is valid (hit Shift-Ctrl-B to build, for instance) and if that's all fine, trigger a manual sync.
  • Due to some Visual Studio implementation oddities, (a) the newly created code region is always expanded when it is inserted and (b) it happens that it doesn't collapse automatically. There's code in place that tries its best to collapse the region and most of the time it works, but when you're tying furiously while sync kicks in - especially when you're hitting Return as well to create new lines - the region might stay open. This doesn't have any technical implications whatsoever, it just doesn't look nice. I'm afraid there will probably not be a solution to this.
  • Finally, I've seen the need to reintroduce the snag of the dead redo list in Visual Studio, as previously reported in B91445 and CB54533. Okay okay, I'm joking, I didn't do it on purpose. But I had to fiddle around with the undo handling after making those structural changes explained above, and for some reason everything now works differently... difference between using immediate and queued edits in DXCore, in case you're curious. I have now managed to make undo work really nicely - it simply skips the automatic changes and undoes (is that a word?) whatever you actually did right before - but Visual Studio still kills the redo list... opening and then discarding an undo unit apparently does that, and I doubt there's a way around it. My apologies to everybody who loves redo - personally I hardly ever use it, so I hope it's not going to be the worst kind of showstopper. Oh yeah, and I should mention that this problem applies only to automatic sync! So using manual sync is once more a workaround if you really want redo functionality.

So that's it - please try the plugin and let me know if you find any problems. I apologize in advance for all issues I've introduced now - when making rather major changes like I did, breaking something also becomes more likely.

Tags
38 comment(s)
Robert Fuchs

> The reason is that I've learned how many other things,

>  apart from querying, users do with the plugin

> and the code it creates.

Do have an example? Sounds interesting.

BTW, thanks for updating the plugin.

7 August, 2008
Pietro Allegretti

Oliver,

I've tryed to do some complex tasks with Linq on XPO based collections I've struggled with performance issues, incomplete support of Linq capabilities on XPQuery. Finally I've tryed to create expressions (dinamically created filters appending more criteria based on a filter form filled by the enduser) with Xpo Criteria using Simplified Criteria Syntax and/or directly using criteria classes, they are very simple to use and complete for this kind of job (even for any other search filter activity), please don't discontinue this usefull plugin.

Piero

8 August, 2008
Oliver Sturm (DevExpress)

Robert,

For example, one person mentioned they were using the field references to configure data binding - I understood they were doing that at runtime, using the field references instead of literal strings for the field names.

Piero,

We've improved a lot on LINQ support since it was first introduced, and features of XPQuery should be pretty much complete now, as I hear. Perf issues would point to a translation problem, since after all the LINQ expression are simply transformed into our own criteria before being executed... if you have such issues, where a LINQ query is slower than one you construct manually, please contact support about it.

8 August, 2008
Martin Hart

Oliver:

How do I synchronize manually? I can't see any option on context menus or on the Refactor! '...'

Thanks,

Martin.

8 August, 2008
Oliver Sturm (DevExpress)

Hi Martin,

There's a line in the list above saying "Manual execution of sync is now possible - configure a key binding for the SyncXPOClass action". That kind of gives it away, don't you think? :-)

Okay, in case you don't appreciate the humor or you don't know how to do this:

* Open the DXCore Options dialog via the menu entry DevExpress | Options

* In the tree list, navigate to IDE\Shortcuts

* Create a new keyboard shortcut (I suggest you also create your own "Martin" folder if you don't have it yet, but that's not essential) using the leftmost button in the little toolbar

* Focus the edit field with the "Key 1" caption and press the key combination you'd like to use for the sync action

* In the Command edit field, enter (or select from the list) the command SyncXPOClass

* Click OK to close the dialog.

Your question is a very good one, btw - I think I'll include a code provider with a future version, which provides a more standard and intuitive way of syncing manually. Thanks!

8 August, 2008
David

How would linq fare with older versions of the .Net Framework?  I still have to support Windows 2000 systems.

8 August, 2008
David

Started using the new version.

I find that it does something similar that the old version did.  It creates multiple copies of...

"XPO nested fields class - don't edit manually"

in my xpo object.  I have to remove them.

Sometimes it will create that code in the middle of a property region if I edit a property.

8 August, 2008
Oliver Sturm (DevExpress)

David,

LINQ is only supported with .NET 3.5, and afaik Windows 2000 is not a supported OS for that .NET version.

If you see cases where multiple regions are created, then it's most likely that this goes back to the CB8627 problem explained above. Please switch off automatic sync, make sure your code is entirely valid and then sync manually. If the same issue comes up when you do this, then I'd appreciate a copy of your code to try and fix it. If it doesn't happen in such circumstances, there's nothing I can do before CB8627 gets fixed.

8 August, 2008
Robert Fuchs

David,

try www.albahari.com/.../linqbridge.html

regards, Robert

BTW: and also try http://www.linqpad.net

11 August, 2008
Robert Fuchs

Oliver,

thanks for the Info.

11 August, 2008
Dirk Weber

Hi Oliver,

just wanted to say thank you for releasing the new version. It is working well for me and the problem I had with the plugin is gone.

As you mentioned above that we are using your plugin to improve our databinding, here is a short line of code to show all the readers here how we're actually doing it:

companyText.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", customerXPCollection, CustomerObject.Fields.Company.PropertyName));

Doing databinding this way and using the field references to configure data binding is a good way for us to improve the stability of our code. We have almost a 1000 fields in our object classes which we connect to our ui with databinding and there always used to be typing errors when we used the normal databinding like

companyText.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", customerXPCollection, "Company"));

When you accidentally write "Cmpny" instead of "Company" you can only find the bug at runtime. With the fields reference you will get all the errors at compile time which is a great improvement.

Dirk

12 August, 2008
Oliver Sturm (DevExpress)

Hi Dirk,

Thanks for the info - I'm glad to say that's how I understood it!

12 August, 2008
GlenG

Thanks from me too Oliver... I've only recently started using XPO and have found the Plugin really useful. The addition of the 'Manual Execution' is the icing on the cake.

Cheers!

12 August, 2008
David

Robert, Thanks!

12 August, 2008
Jim Clay

Since this has been getting good reviews, I thought I would implement the pluggin.  One issue I am seeing is that I use namespaces heavily and it misses adding the namespace on types and I need to manually go in and edit the generated code to add the namespace.

13 August, 2008
Oliver Sturm (DevExpress)

Hi Jim,

I guess you mean that you use namespaces on the types directly instead of the "using" statement, right? Interesting, I'll look into that. Thanks for letting me know.

13 August, 2008
Jim Clay

Oliver,

I am using VB and am organizing my business objects by Namespace.  So when I define a property say of a user, which is in my "Security" namespace, from within a Workorder, ("WorkOrders" namespace) with this for example:

Dim fArtFileBy As Security.User

Public Property ArtFileBy() As Security.User

Get

Return fArtFileBy

End Get

Set(ByVal value As Security.User)

SetPropertyValue(Of Security.User)("ArtFileBy", fArtFileBy, value)

End Set

End Property

The plugin doesn't take into account the Security Namespace...I just found that when it autosyncs it removes my manual adjustments, so at this point I will probably pull back on using the plugin as I don't want to have to redo my 80+ objects.

Thanks.

13 August, 2008
Jim Clay

OK...SO I had a MAJOR "OH DUH!!!" Moment here.  WAY too many things going on right now and apparently am not thinking straight.  Yes I can use Imports (Using) and will give that a go.  I had originally planned on referencing direct, but can easily change this one...

Anyway, it is still a situation that at least you are aware of now.

13 August, 2008
David Partridge

Question,

I have the manual sync working great on my work computer (universal sub).  At home, I have the free version of refactor with dx core. I have purchased XPO for the home computer but I do not have the devexpress menu item to set up manual sync.  Does this plugin only work with code rush?

25 August, 2008
Oliver Sturm (DevExpress)

Hi David,

The plugin is made to work with any basic DXCore installation. The problem you are seeing comes up because the free R! versions don't make the DevExpress menu visible by default. (Our stand-alone free DXCore installation does, btw, even if you install it on top of a free R! installation.)

If you have only the free R! version installed, you can make a registry modification to enable the DevExpress menu. As usual, please be careful when doing this!

You'll need to change the key

HKEY_LOCAL_MACHINE\SOFTWARE\Developer Express\CodeRush for VS\3.0\HideMenu

Please set it to 0 (zero) in order to make the menu visible.

25 August, 2008
David Partridge_1

Sorry it has taken so long to get back to you.  I have enabled the menu item.

I dropped the plug in into the dxcore plugins directory.  It shows up under the core/plugin manager however it is not a selection that is available in IDE\Shortcuts command edit field.

I have tried entering SyncXPOClass directly into the dropdown but it still will not sync my xpo classes. Help?

13 September, 2008
Oliver Sturm (DevExpress)

Hi David

Hm, that's very weird. Do you see the options page for the plugin (at Editor\XPO)? If so, the plugin is loaded correctly, and I couldn't guess why its registered actions shouldn't be available. If not, the plugin is not loading correctly for some equally inexplicable reason... just to be sure, you are using a current version of DXCore, right? This build was compiled against 3.0.8, so anything older than that is bound to give you problems.

16 September, 2008
Sean Gifford

We have an inheritance structure setup that I don't see how to work with the Simplified Criteria Syntax and the Fields implementation:

If base class has property "Name", how to reference Fields.Name on the descendant class?

Thanks, have really enjoyed the improvements in this version of the plugin!

17 September, 2008
David

No, the options page does not have Editor\XPO

Version 3.0.8

I dropped the file into

C:\Program Files\Developer Express Inc\DXCore for Visual Studio .NET\2.0\Bin\Plugins

The file shows up as a plugin on the plug in manager option

do I need to do some type of registration?

17 September, 2008
Oliver Sturm (DevExpress)

Hi Eidem

I should have another look to verify, but isn't it so that the fields class in the derived class is derived from the fields class of the base class under such circumstances, so that you can access fields of both base and derived class?

18 September, 2008
Oliver Sturm (DevExpress)

David,

No, no registration needed. I'm afraid I don't have an explanation for this right now. The only thing I can imagine is that there is something special about your situation with only DXCore available - although, since the plugin requires only the base DXCore libraries, that is a rather weird thought. I'll try to find some info, or reproduce that problem, but I'm afraid it might take a while since I'm on my way to a conference tomorrow and the tests require a setup that equals yours.

18 September, 2008
Oliver Sturm (DevExpress)

Hi David, again,

I just heard back from our support guys, whom I'd asked if they were aware of any additional requirements. They would like you to contact them directly, so they can investigate this further. Could you please get back to them, either through support@devexpress.com or our Support Center at www.devexpress.com/.../center ?

18 September, 2008
David Partridge

Thanks Oliver

for your reference,

www.devexpress.com/.../B130039.aspx

18 September, 2008
Sean Gifford

Oliver,

Yes, thank you, we hadn't refreshed our base class Fields definition.

Once updated, derived Fields showed the base Fields properties.

18 September, 2008
Mike

Thanks for keeping it alive, Oliver.

I don't believe that LINQ is supported in the compact framework version of XPO, is it? Therefore, I guess this plugin is my best option for moving away from using strings in criteria statements.

21 October, 2008
Gary's Blog

In a previous post we looked at two ways to create criteria and I finished by warning that those methods

30 December, 2008
XPO Simplified Criteria Syntax « ALFWare IT Services

Pingback from  XPO Simplified Criteria Syntax «  ALFWare IT Services

14 September, 2009
Reno Slot Machines Hotel Casino, Harrahs Reno Nevada

Pingback from  Reno Slot Machines Hotel Casino, Harrahs Reno Nevada

21 May, 2010
850csi Part Sale, Storm Wholesale Original Blackberry Gsm 850

Pingback from  850csi Part Sale, Storm Wholesale Original Blackberry Gsm 850

21 May, 2010
C320 Shop C330 And C340, C320 Aftermarket Car Led Tail Lights

Pingback from  C320 Shop C330 And C340, C320 Aftermarket Car Led Tail Lights

22 May, 2010
Nissan Sentra Replacement Headlight Assembly, Nissan Sentra Bulbs Replacement Headlight Assembly

Pingback from  Nissan Sentra Replacement Headlight Assembly, Nissan Sentra Bulbs Replacement Headlight Assembly

22 May, 2010
3600 Promotion, 600 Bus

Pingback from  3600 Promotion, 600 Bus

22 May, 2010
620 Bulb Nissan 300zx 240sx, Pixma Mp620 Apple

Pingback from  620 Bulb Nissan 300zx 240sx, Pixma Mp620 Apple

22 May, 2010

Please login or register to post comments.