Search This Blog


Thursday, February 26, 2015

How to implement and where to put business logic in XAF?

We have recently rolled out another update of our online documentation where we isolated and detailed one of the most common questions beginners have. Actually, the answer was already present in the docs, KBs and examples and we have just reorganized these learning materials so that you need to know is in one place.

Please be sure to check out the new concepts section at eXpressApp Framework > Concepts > Data Manipulation and Business Logic even if you are an experienced XAFer. This is not the final version and we have several updates planned for this section in the near future.

If you are getting started with the framework, then running through the eXpressApp Framework > Getting Started > Basic Tutorial (SimpleProjectManager Application) tutorial will be a prerequisite.

I also want to remind you that our What's New documents for new product versions include the lists of documentation changes (What's New In Help) where you can find other interesting stuff like this, e.g.: this is what we have in v14.2.5 for XAF.

Please let me know what you think in comments to this blog. Thanks in advance!

Check out an example demonstrating a possible way of integrating Snap reports in an XAF WinForms application

The example integration shows how to store DevExpress Snap reports layout in business objects and show a list of these objects, as this is done in the built-in Reports module. The main tool for working with these reports is a custom Snap designer form. Underlying business objects can be configured using custom buttons from this form. It is also possible to show a read-only preview form using corresponding actions.

You can download the actual test project and research the example implementation from here: 

Wednesday, February 25, 2015

Starting with v15.1, XAF Web pages will be rendered using the HTML5 document type mode by default

We primarily needed this for better operation of the ASP.NET end-user report designer we integrated in XAF v14.2 + some other great stuff we are currently working on for the next major release.
Technically, this means that XAF *.ASPX pages will have <!DOCTYPE html> at the top and there will also be the doctypeMode setting in the web.config file:

  <settings rightToLeft="false" doctypeMode="Html5" ieCompatibilityVersion="edge" />
<compression enableHtmlCompression="true" enableCallbackCompression="true" enableResourceCompression="true" enableResourceMerging="true" />
<themes enableThemesAssembly="true" />

You can learn more on this setting in the documentation for our ASP.NET controls.
Take special note that this rendering mode slightly changes alignment of images within table cells as per,_Tables,_and_Mysterious_Gaps
With this mode, our ASP.NET controls also globally adjusts tables and their cells as per this styles definition:

 /* Html5 styles */
 table { border-width: 0; border-collapse: collapse; border-spacing: 0; }
 td, th { padding: 0; }
 .dx-p1 { padding: 1px; }
 .dx-p2 { padding: 2px; }
 .dx-p3 { padding: 3px; }

In general, this post is just for informational purposes only as there is nothing to worry about for you - everything will "just work" as before, but a bit better:-)

Tuesday, February 3, 2015

Storing security settings (users, roles, permissions) and application-specific data in separate databases

I wanted to inform the community of a solution we have just finished testing for the next XAF version in response to the following customer's business scenario:

"We have 2 content databases and we will be running multiple applications on the same databases. Therefore i would like to have a separate database for each application to store the application specific data in...For security reasons we are not allowed to store security data in the same DB as our other data. It not our choice."

Wednesday, January 21, 2015

Simplifying integration of custom controls bound to data from XAF application database - YOUR FEEDBACK IS NEEDED


We are researching options to make it easier for our users to achieve the subject in the next version. One of the popular scenarios we were aware of from our users was integration of custom controls, often created in Visual Studio using the standard WinForms or ASP.NET WebForms approaches, and primarily designed for presenting data from the XAF application database in some very custom manner so that built-in XAF Property Editors  or List Editors were not good for this. For instance, you might want to show a list of records in a fancy grid with cards, image gallery or other controls or modes not integrated by default.

Current solutions and problems

XAF is very extensible framework and offers many ways of integrating custom or third party controls. We noticed that while doing so, feeding these custom controls with data from the application database was often a challenge for our users. This binding is done automatically for built-in forms and data editors, but requires writing some code that will read data via the IObjectSpace.GetObjects<T> method (to respect data security filters) and also listen to the IObjectSpace.Reloaded and other events to handle data updates. Finally, designing a data bound user control in Visual Studio often implies a direct connection to the database or using specialized data sources (e.g., to generate a list of grid columns or pivot fields), which do this for you. The latter forces you to think about obtaining an application connection string at design time, while this dynamic part is changed later in the most cases. Add to this different approaches for Entity Framework and XPO and you will get the whole picture.

New solutions (not yet built-in!)

Briefly, we decided to simplify this scenario. Here are two videos that shows one possible option:



How it works?

In short, the proposed flow is as follows: