ANN: DXCore XPO plugin

XPO Team Blog
07 August 2008

Version of the XPO plugin is now available, compiled against DXCore 3.0.8. Please download it here: (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.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.