This Blog


Favorite Posts


June 2008 - Posts

  • Breaking Changes for v2008 vol.2 (frameworks)

    These are the breaking changes for the the frameworks (eXpress Persistent Objects, XPO, and eXpressApp Framework, XAF) in v2008 vol.2. Breaking changes for the UI controls will be discussed in another post.


    • IXPSimpleObject is now derived from IXPClassInfoAndSessionProvider. This may affect those who implement their own base object, however, typically people don't implement that interface.
    • Additional checks on the correctness of actions has been added. This should proactively reduce the number of 'objects with duplicate keys', 'not a clonable hierarchy' and suchlike exceptions. Against that, this could break some cases that seem to work ("seem" being the operative word). Also, XPBaseObject.IsLoading behavior has changed; it is now it just an alias to Session.IsObjectsLoading.
    • XPClassInfo.GetMember does not return nulls anymore, instead throwing PropertyMissingException instead. Use XPClassInfo.FindMember when you prefer getting null instead of an exception.
    • PropertyTypeMismatchException has been deprecated in favor of the more general AssociationInvalidException.
    • XPCollections participating in associations (refcollections) are not dropped anymore on IXPObject.OnLoading.
    • S19881 (was Q103543): using non-associated collections in criteria is not allowed any longer. It was not designed to work before, but would sometimes coincidentally work.

    eXpressApp Framework

    • The NewObjectViewController's ProcessNewObject event has been removed. To change a newly created object, use the ObjectCreated event. To change the way the new object is added to a collection, use the CustomAddObjectToCollection event.
    • The ListView.ProcessSelectedItemAction and ListEditor.ProcessSelectedItemAction properties should not be used anymore. You should use the ListViewProcessCurrentObjectController.CustomProcessSelectedItem event instead.
    • We have created a base DevExpress.ExpressApp.Scheduler.v8.2.dll assembly for the WindowsForms and ASP.NET Scheduler modules. In your projects that use DevExpress.ExpressApp.Scheduler.Win.v8.2.dll assembly, just add a reference to the DevExpress.ExpressApp.Scheduler.v8.2.dll assembly.
    • The LocalizedClassInfoTypeConverter class has been moved from the DevExpress.ExpressApp to the DevExpress.Persistent.Base assembly. Add the corresponding reference if needed.
    • The S30087 ("Security: Roles that do not have Read access to object should not see Navigation items") suggestion has been implemented, but there are breaking changes. Before v2008.2, the "Read" access level included reading objects and navigating to them via the navigation control. From v2008.2 onwards, the "Navigate" operation is managed by the Navigate item of the ObjectAccess enumeration. For backwards compatibility, previously created security settings ("v7" or "v8.1") are automatically extended with the "Navigate" access level if the "Read" access level is granted. However, when creating new security permissions, you should manually grant the "Navigate" access level in addition to the "Read" access, except for the case when you specify the "AllAccess" level.
    • The ItemBase class' CreateControl abstract method has been renamed to CreateControlCore
    • The PropertyCollectionSource class' "XPMemberInfo.PropertyInfo" is replaced with the "IMemberInfo.MemberInfo" member.
    • The ExecuteSetFilter method in the FilterController class has been removed. The SetFilter method should be used instead.
    • The ExecuteFullTextSearch method in the FilterController class has been removed. The FullTextSearch method should be used instead.
    • The Manager property in the Frame class has been removed. The Application property should be used instead.
    • The DialogController.IsAppropriateContext property does not work at all now.
    • The IsValid(object target) method of the IRule interface and the RuleBase class was replaced with the Validate(object target) method that returns a RuleValidationResult value instead of a bool.
    • The Properties property of the IRuleBaseProperties type has been added to the IRule interface. It is used to automatically show a rule's properties in the Application Model's Validation node. If you implement the IRule interface, you can return an instance of the built-in RuleBaseProperties class. This class contains all the basic properties such as Id, TargetContexts, TargetObjectType, Criteria and so on. If your rule needs additional properties, implement a descendant of the RuleBaseProperties class and declare your properties. These properties will automatically be added to the Application Model for each instance of your rule.
    • The IRule.Contexts property has been removed. Use the IRuleBaseProperties.TargetContextIDs property of the object that is set for a rule's Properties property instead.
    • The IRule.Description property has been removed. Use the IRuleBaseProperties.CustomMessageTemplate property of the object that is set for a rule's Properties property instead.
    • The IRule.DetailedDescription property has been  removed. Use the IRuleBaseProperties.CustomMessageTemplate property of the object that is set for a rule's Properties property instead.
    • The IRule.Error property has been removed. Instead, use the IRuleBaseProperties.CustomMessageTemplate property of the object that is set for a rule's Properties property, and the result value of the IRule.Validate method instead.
    • The IRule.GetErrorMessage method has been removed. Instead, use the result value of the IRule.Validate method instead.
    • The IRule.ToString method has been removed. It is no longer supported.
    • The SkipNullOrEmptyValues property is now checked in the RuleSet class instead of the RuleBase class. So, if you call the Validate method of a particular rule directly, the SkipNullOrEmptyValues property won't be considered. To check this property, create a temporary RuleSet object, register the required rule within it and call one of the RuleSet's validation methods.

    [ Bookmark with: Delicious, Digg, Reddit, StumbleUpon ]

  • Video: Current Row with DXGrid for WPF

    Later the same day as this previous video was taken, I sat down again to record another on using DXGrid for WPF.

    Looking at this video I'm struck by how much I hated the keyboard. Let me tell you -- and this is by no means a religious issue, no sir -- but the natural forces of the universe acted together to create the editing pad on the keyboard like this:


    And most definitely there's some serious warping of space-time when the layout looks like this:


    Yes, I kept hitting that stupid big Delete key instead of the End key.

    Nevertheless I persevered and produced a video on accessing the data of the current row inside another panel on the same window. No programming, just XAML.



  • Video: Binding DXGrid for WPF to data

    I've been at our Glendale office all week and, as usual, it was meetings galore discussing the various aspects of running a company like DevExpress.

    Nevertheless, I made some time to sit down with Jeff, our videographer, and record some videos about DXGrid for WPF. This is the first: an introductory video about binding a DXGrid to data from a database.



  • LINQ, LINQ, say no more

    [Update June 20, 2008: Audio version added:]

    You can also download the mp3 file to your iPod, Zune, or other mp3 player: LinqLinqSayNoMore.mp3

    An interesting question that someone asked of me recently, indicating perhaps that the information from Microsoft about it isn't getting across very well, was what is LINQ?. To me there are two aspects of LINQ that I find compelling, and in just narrowing it down to those two aspects, I'm probably doing it just as much a disservice as I implied Microsoft were doing just then.

    The thing is, there is a lot of information, very detailed information, about certain attributes of LINQ, but it tends to focus on one or maybe two areas like query expressions and LINQ to SQL, and then things like the var keyword gets mixed in somehow.

    Let's start from the beginning. C# and VB and a lot of other languages we learned at our mother's knee are known as imperative languages. Well, they're also known by a number of other monikers invoking how "typed" they are, but I'll ignore that for now.

    Imperative programming languages involve the programmer detailing to the nth degree exactly what the program should do. In essence, the programmer writes a set of commands for the computer to execute. The order of the commands or statements he writes dictates the order in which they are executed. (To be strict, .NET does allow the compiler and JITter to reorganize these statements internally to a certain degree, but since many people don't understand what this can mean, we'll ignore it.)

    If the programmer needs to iterate over a bunch of records from the database, for example to find all the records that match some criteria, he has to write a loop of some description, worry about the bounds of the loop, and then work out the statements that need to be executed inside the loop for each record. Of course, he also has to worry about where to put the records that match, which involves other issues and problems that need to be solved.

    Compare that mode of working with SQL. This is a declarative language, and furthermore one that operates on sets of data. Here if you want the set of records that match some criteria, you write a WHERE clause in your SQL statement and don't even worry how the database engine works out or stores the set of records you needed. Sure it may be done with a loop, or it may be several loops, one per CPU, or it may be some other mechanism entirely. The result set may be in memory, it may be on disk, or it may be a bunch of pointers to the original records. What matters to the programmer is the end result: what looks to be a set of records that he can then manipulate.

    The first aspect of LINQ that I find fascinating is the melding of a query syntax that returns sets of objects (a declarative language) into an imperative language with all its loops and ifs and whatnots.

    The C# designers have been very clever in this respect. First of all, they introduced the language extensions known as Language Integrated Query (or LINQ) that everyone first thinks of when they see the letters L, I, N, Q. LINQ in this regard is a language within a language, a way of abstracting out the SQLness and the XPathness from their respective query universes.

    To go along with this is a much enhanced set of generic interfaces and types, especially centered around IEnumerable<T>. This interface in particular has had new extension methods written (like Where(), Select(), and so on, all within the Enumerable class in System.Linq) that take a delegate, usually implemented as a anonymous method, to act on each item in the collection, and that return another collection. Then they married this up with type inference system and automatic type creation and the var keyword.

    All in all, this is the LINQ that people think of, and it is most amazing. The ability to specify a query that will return some collection of objects (sometimes the objects are of some type that has been created specially for this query) and then be able to act on the set in toto using some of the new methods and passing anonymous methods along for the ride too, is a quite staggering achievement.

    But that's not all, as they say in the best ads.

    When you write a LINQ query, what happens to it? Well, the one and only thing that happens until run-time is that the compiler will compile the LINQ expression into an expression tree. It does this for two reasons: the first is that LINQ expressions will get parsed at compile-time and will trigger compile errors should the expression be invalid. The compiler will convert the LINQ expression into an expression tree (more fabulous .NET Framework code has been written to create, navigate and execute expression trees -- they're not linked to LINQ especially).

    Of course, it won't actually execute the expression tree (or, equivalently, execute the query) until run-time, since the data source is only known at that point. But the second most amazing thing about LINQ, in my view, is that the LINQ expression is only executed when it needs to be, at the absolute last possible moment. In other words, if you have

    var bestCustomers = from c in customers 
    where c.SalesTotal >= 1000000
    select c;

    Then at run-time bestCustomers will remain in a kind of limbo not exactly full of data -- a bit like Schroedinger's cat, neither here nor there -- until you actually try and do something with it, like print out the customers. If it turns out that, through the execution of the program, you don't actually reference the data in the bestCustomers collection, it won't be there, and the query won't be executed.

    Something even more fascinating: if I write this

    var superCustomers = from c in bestCustomers 
    where c.SalesTotal >= 10000000
    select c;

    Then this declaration of superCustomers still won't cause the bestCustomers query to be executed. Trying to enumerate superCustomers will cause two queries to be executed: first the one for bestCustomers and then the one for superCustomers. But if I don't enumerate superCustomers, this won't happen.

    Microsoft refers to this as deferred execution, and MSDN has this to say: This method [Select()] is implemented using deferred execution. The immediate return value is an object that stores all the information required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in Visual C# or For Each in Visual Basic.

    So if you have an amazingly ornate LINQ query expression (and I'm thinking of Luke Hoban's ray tracer code implemented as a LINQ expression as an example), then it will only suck up CPU time if you need the result of the expression. This deferred execution is to me an astounding achievement, something you should strive for in your own code.

    Even better: the objects in the collection that results from the LINQ select operator may not all be resolved at once. They may be resolved one by one as you use the enumerator, or even in batches. It doesn't matter to you how its implemented, all you know is that if you enumerate the objects, you will get them.

    After that, it's all a bit of a downer: the LINQ provider will convert the expression tree into something that its domain understands and then executes that. So, for example, LINQ to SQL will convert the expression tree to a very optimized SQL expression and execute it. This is pretty good code too, but for some reason it doesn't float my boat as much as the other two aspects of LINQ.

    So there you have it: LINQ in the eyes of the beholder named Julian.

  • Glancing back

    I thought I would just point out a few of my posts from the past -- raising them into your consciousness, as it were -- because they are still just as relevant today as when I posted them initially. I'm also told by our client services department that they reference some of them to callers so I'm guessing newcomers to my blog would benefit too.

    These posts aren't about our products per se, but more about how we do business, our policies, what you can expect from us, and so on.They're in reverse order of posting.

    Selling snake oil: please don't buy a product based on its possible or putative future features but on its value to you right now.

    When is a layer cake healthy?: discussing our licensing policy and how to limit the money you pay us by layering your application. Uh, hang on...

    Shall I compare thee to a summer's day?: we don't publish comparisons. Here's some logical reasons, but really it's about ethics.

    Calling Occupants of Interplanetary Craft: how to get in touch with me.

    Can't Fix? Won't Fix!: a discussion about how we flag issues in Support Center (note that the product versions I talk about as examples in here are very old).

    "That (expletive) support!": why you will sometimes get requests for a sample program that reproduces the issue you're talking about.

    Breaking changes: a necessary evil; why we have them, and how we endeavor to reduce them.


  • Transcript for old geezers like me

    I see that Ray uploaded the video that Mark and I did a couple of weeks ago on Selection Embedding in CodeRush. It's a good video, I think (and not just because I'm in it Smile), with lots of good content, but it shows that we were still finding the best way to blend the video and screencast. This one, for example, has the text in the screencast a little too small for old guys like me (heck, I'm even wearing my glasses for the video).

    So to quickly recap the main points:

    • CodeRush training window helps you learn the keystrokes for CodeRush as you type. DevExpress | Tool Windows | CodeRush.
    • The Keys window is an extra plugin for DXCore, available from support. It's good for demos.
    • If you have a selection in the editor, CodeRush provides some functionality, accessed by a single key, that will embed the selection. Examples given included F for try/finally, C for try/catch, T for try/catch/finally, L for lock(), U for using(), W for wait cursor, B for a block in braces.
    • Some other embeddings are available in the context menu (right- click menu). Examples given: while(), do while() and Comment Box.
    • In discussing selections, we mentioned that Ctrl+W widens a selection by logical, syntactic block, Ctrl+Shift+W shrinks it. (The Numpad + and - do the same.)
    • There are some features that modify the code instead of embed it, example given was Inversion (Ctrl+Shift+I) that inverts the meaning of code. Examples given were changing the setting of a bool variable (from "boolVar = true;" to "boolVar = false;", for example) or for swapping over the LHS and RHS of simple assignments (from "intVar = otherIntVar;" to "otherIntVar = intVar;", for example).
    • To write your own embedding: DevExpress | Options, search for "Selection" to get to the Embedding page of the Options dialog.
    • In writing your own Selection Embeddings, there are four styles you can use: Surround (like the Comment Box example), Top/Bottom (inserting lines above and below the selection), Left/Right (each line gets something added to the left and/or right of the selection, the example being to comment out each line), Top/Middle/Bottom (the top and bottom lines get special treatment form the middle lines of a selection), Before/After (some text inserted just before and after the selection).
    • String providers are functions that return a string. Examples given were UserName (for the current user's name) and Date (for the current date).
    • Binding to a keystroke: DevExpress | Options, search for "shortcuts".
    • The easiest way to create a new shortcut is to find one that works roughly the way you want yours to work, right-click the shortcut, choose Duplicate Shortcut and then edit the duplicate. The context in which the shortcut is active comes along as well (although you can copy/paste a context from another shortcut if you want).

    I hope that helps a little.

  • Bug reporting and tracking

    There's a new website in town, one that's a grand experiment in community involvement in bug reporting and tracking.

    The site is being run by Long Zheng and is named Windows UX Taskforce. He (and many others for that matter) noticed that although Vista has an improved user experience (UX) than XP does, there are a whole lot of little niggles and inconsistencies within Vista that don't follow the UX standards. So he started documenting all these issues in the hope that Microsoft would fix them in time for Windows 7.

    Before long, he came to the conclusion that he couldn't do it all himself, and decided to invite "the Vista community" to help him. That became too much too, and so he wrote a nice-looking application to track it all.

    It's a very Digg-like application. Registered users not only use it to report user experience (UX) issues in Windows Vista, but they can also vote on them in a Digg-like manner by promoting or demoting each issue. You can comment on each issue too to argue for or against.

    Zheng's hope is of course that it will take off enough that Microsoft will take heed of the reports and act on them in time for Windows 7's code freeze.

    The reports database is very basic compared with full-fledged commercial bug tracking databases, but it doesn't matter since it tracks a description of the issues, a screenshot, a possible solution, a status, and flags for severity and impact, and a discussion message thread which is all you really need for this application. The RSS feed is similarly basic too: only new items are reported and not every change in the vote. But there's enough to be getting on with, and enough for the community to get their teeth into.

    Of course, it's not all sunshine and roses. It's not connected to Microsoft's bug database in any shape or form, although an import wouldn't be hard to write. There's no guarantee that Microsoft will act on anything here, but it certainly would behoove them to do so. I'm also not sure how it's moderated: for new reports, for vote-spoofing, or for spam or undesirable content in the discussions.

    On the plus side, it was a quick app to write and it succeeds admirably at what it does.

    Having said all that, and because I work for DevExpress in a management position, I'm going to get asked, well, where's our version of this? A nice simple application, community maintained, and one that would give DevExpress a great deal of information to help them decide on what needs to be done.

    Well, we already have it: our support center. There are some differences, of course.

    • our "voting" is done by counting the number of people who are tracking each issue
    • you can't vote to demote an issue: either you vote for it, or you're not voting at all -- this tends to aid the "squeaky wheel" customers
    • our "voting" numbers are hidden from public view
    • support center is actually our bug tracking database, so there's no import to do
    • we track more data, such as sample code, version numbers, OS details, etc
    • our RSS support is even more primitive (there's no way to be notified of all new public issues added, for example)

    Once we release the Code Central part of Support Center, we'll revisit some of these items to see whether we can't improve things a bit.

  • Silverlight Grid: AgDataGrid has its own forum

    Just a quick note to say that AgDataGrid now has its own forum.

    Which of course means we're very close to releasing our Silverlight Grid into beta...

  • Silverlight layout control: Area51 has been fully updated

    With all the brouhaha going on about the AgDataGrid, it's easy to forget the layout controls that our Silverlight guru Vlad wrote way back when, when the world was young and Silverlight was but a 1.1 alpha release.

    Although with the grid it's easy to see the benefits you get (tabular data! sorted columns! grouping! etc), with the layout controls the benefits aren't so easily discernable. It's only when you try and use the panels provided in the Silverlight Framework that you realize what a great product this is going to be. (Martha Rotter at MS Ireland agrees.)

    He's updated the demos for the various layout controls (the flow, the docked, and then the uber layout control) in the Area51 part of our website to work with the just-released Silverlight 2 beta 2.

    Do go visit and play around with these demos. If you find an issue or a bug, please email support@devexpress.com. They'll make sure that Vlad knows and will respond.

  • Silverlight Grid: AgDataGrid demo unleashed!

    We've now completed the minor bugfixes needed to ensure that our grid for Silverlight 2 works with the just-released beta 2 bits and we can now make the demo public.

    A couple of notes though before I link to the demo page:

    1. You need Silverlight 2 beta 2 installed. This demo will not work with beta 1. You can download the latest beta here.

    2. We are still finalizing the legalese in the EULA for this grid, but rest assured that when we said free, we meant free as in beer, and when we said source code included, we meant the CS files as well as the XAML files.

    3. Once we've completed the final stages of writing the EULA we'll release the grid into beta. The release date of the final product depends entirely on you, our early adopters, playing around with the beta, giving us feedback and letting us know of bugs and issues.

    OK, having got the caveats out of the way: here's the demo. Have fun!


Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383


DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners