Search This Blog

Tuesday, December 30, 2014

About XAF Types Info Subsystem...

I have just closed the DC - Provide support for dynamic members in domain components ticket with two possible solutions (there were some specifics with regard to the late generation of real XPO classes for DC interfaces) and wanted to use this chance to draw your attention to some advanced stuff you may need one day - customizing your data model metadata at runtime via the underlying types info subsystem (ooohhh!)

In short, you may need customizations at this low level when you want to dynamically adjust your ORM data model mappings to the database, add or remove custom members for your data model at runtime (e.g., based on the info stored in the database, XML settings file or any other source) when implementing an app tailored to a specific client/user access rights, etc.

Leaving customizations aside (which is quite rare, to be honest), accessing information about the types (their metadata) registered within the XAF application is really common. For instance:

  • If you want to check what business class this View is for - check the View.ObjectTypeInfo property. 
  • If you want to check the member a PropertyEditor corresponds to - check its PropertyEditor.MemberInfo property.
  • Need to know whether a business class has a certain property? Use the ITypesInfo.FindMember or ITypeInfo.Members APIs.
  • Want to know which code attributes are applied to a class or property?  Call the IBaseInfo.FindAttributes method (check examples here).
  • Want to get/set a class property known only at runtime? Use the IMemberInfo.Get/SetValue methods (see an example in the end of this article - it's like .net reflection, but faster).

Our documentation describes this in several articles here:
eXpressApp Framework > Concepts > Business Model Design > Types Info Subsystem

I have also prepared a small schema to better explain the role this type of info subsystem plays:

As you can see from the schema, this 'types info subsystem' serves as a source for Application Model and thus UI generation. That said, in certain scenarios, you may want to access certain info at a higher level instead of accessing the types info subsystem directly.

If you are anxious to see more advanced XAF stuff today, consider reviewing my previous post at
How to customize the underlying database provider options and data access behavior in XAF.

See Also:
eXpressApp Framework > Concepts > Business Model Design > Data Types Supported by built-in Editors

Friday, December 26, 2014

A sporadic Visual Studio issue with the incorrect Action constructor after modifying Controller (Finally bypassed in 14.2.4!)

Have you ever seen a situation when your Actions defined in the Controller designer worked well, but one day they disappeared from the application UI and were no event present in the Application Model? Unfortunately, we sometimes did, and so did our customers under certain circumstances. The difficulty of this situation is that this annoying behavior in the IDE was truly random and sporadic, as it all might work on the same machine and then fail without any reason under the same circumstances, with no environment changes. This behavior could be reproducible with both new and existing Controllers and Actions. Our Controller/Action/designers code was fine and the same issue could be reproducible even with the standard Component Designer and standard MS components, so it was eventually reported to MS Connect:

This problem was not massive, to be honest, but the reports the report count reached a reasonable threshold within several years... 

Since we still continue to receive reports from our customers on this behavior from time to time, which negatively affects their experience with our product, we decided to introduce a special "hack" on our side, which helps avoid this behavior. This fix successfully worked in our tests with the problematic virtual machines where we happened to semi-stably isolate this strange behavior. This improvement is available starting with version 14.2.4 and I recommend you upgrade to this version if you experienced this behavior in the past.

Hopefully, you will never experience this again, and Happy XAFing/holidays!

An Entity Framework version of our XCRM demo

You might have noticed that starting with v14.2 we made an EF-based version of our popular XCRM show-case demo. It is installed at %PUBLIC%\Documents\DevExpress Demos 14.2\Components\eXpressApp Framework\XCRM\ by default.

Data models and DbContext code are located within the XCRM.Module\Data\ folder for you to explore. These data models are built for real and quite complex scenarios, so you can use this as a reference in addition to our two other Entity Framework demos:

  • %PUBLIC%\Documents\DevExpress Demos 14.2\Components\eXpressApp Framework\EFDemoCodeFirst\
  • %PUBLIC%\Documents\DevExpress Demos 14.2\Components\eXpressApp Framework\EFDemoModelFirst\

Thursday, December 25, 2014

XAF 14.2 webinar recording and other interesting videos

I am late with this announcement, but still want to share a link to the webinar we made in early December where Seth demonstrated certain XAF 14.2 features live and talked about XAF application development in general: 

As always, there was also a Q/A session during the presentation: certain questions were voiced live and others were answered by our XAF team in chat. Frankly speaking, we had hundreds of questions about the new functionalities so our keyboards got hot quickly. We could not even handle all the questions so I am thinking about running another pure QA session around January/February. There we could present the most frequently asked questions and general information about the new bits and maybe present some new developments. Honestly, our team really enjoys such live sessions where we had a chance to talk to each other, ask questions and answer yours. Please let me know what you think of this idea in comments.

You know, Seth Juarez, our Analytics Program Manager at DevExpress, is a presenter from God, so if you are new to XAF or not yet getting the ideas behind it well, I recommend you watch another presentation made by Seth: A Gentle Introduction to XAF.

During the webinar, there was also a survey with a few questions for the auditory. Here are poll results (based on the 154 attendees) for your reference: 

Looking for practical experiences with both DevExpress XPO & ADO.NET Entity Framework

You know that XAF supports both ORM libraries to almost the same extent, so there is no noticeable difference at the framework level (see 1, 2, 3) that should affect your choice in favor of a certain data access tool. There are, however, some differences between these ORMs in their functionality, usability, history and other factors which may indirectly affect your choice.

We do not provide comparisons of our products with competitors (mainly from an ethical point of view), but I think it would not hurt anyone if there was a list of proven opinions from users who had practical experience with both ORM tools. I already started collecting this list and among differences our users mentioned was, for instance:

Tuesday, December 23, 2014

A small usability improvement to the new visual ListView designer available in v14.2

Thanks to our great customers and their feedback in this Support Center ticket we could make our recent addition to the Model Editor yet better. Starting with version 14.2.4, it will be much more convenient to view and configure ListView with lots of columns, because now the horizontal scrollbar will be displayed in this situation. A picture is worth a thousand words:

Of course, the live preview will also respect column sizes set in the property grid for each IModelColumn object.

What's New in XAF 14.2 Documentation

In addition to the new great features the version 14.2 introduced, there are also improvements to the learning materials that will allow you get the most of DevExpress products. 

The full list of What's New In Help for all products is waiting you here.
The XAF documentation changes are listed here. In particular, I wanted to focus on the restructured and improved Business Model Design section, which is, in my opinion, one of the most important things that contributes to overall understanding of the framework and its development process. 

My other favorite help topic is eXpressApp Framework > Concepts > UI Construction > List View Data Access Modes. Hopefully, even people familiar with the framework will find something helpful here.