Monday, March 29, 2010

When working with Xaf and MVC pattern in order to create actions we are using controllers and initialize them upon them. The default behavior of Xaf is to place our actions in the default toolbar of our view.

What if we want to position our actions somewhere else in the view? Then we need to create a custom detailviewItem and write our code against the interface exposed by the detailviewitem. I really did not like the idea , I really wanted to continue to design my actions behavior against the controller interface so i have added an ActionButtonDetailItem for both win and web platforms that can be installed declaratively using the model like

bind it to the action we want like

and position it anywhere we want using Dx layout component to create our views like

Monday, March 22, 2010

This one is the most complex implementation of the logic architecture cause this module is really a facade module. ActionState and ControllerState modules are hosted within it. But the implementation for each one of them as you see in the image bellow really looks alike

In order to control the different in model schema than the one that is provided bu defaul I have override the require methods of ControllerStateModule

Friday, March 19, 2010

AdditionalViewControlsProvider is a module that it only knows how to display a given control in a given position . So one could easily define an interface for the parameters needed when this behavior is implemented as

take a note that I inherit IConditionalLogicRule thus logic engine can evaluate the IAdditionalViewControlsRule like it is a conditional rule meaning that is going to create all properties of conditionalLogic+ logic for my attributes, model , permission

Everything you see in the above image is automatically generated for you if you provide the require classes

the above classes implementation is just a property implementation without any logic at all see for example

Thursday, March 18, 2010

Say you want to make your rules conditional , meaning that you want your rules to be executed when certain criteria are valid for a given object. That is implemented at eXpand.ExpressApp.ConditionalLogic.dll assembly.

Monday, March 15, 2010

Xaf architecture and especially the model part is great. What it really teach us is how to parameterized our logic/behavior/code and store that parameter in the model in the form of attributes on already existing nodes or on rule nodes see Xaf Validation system or ConditionalEditorState system. eXpand has provided a similar architecture through its ModelArtifactState module.

But after you start using such “ruling” modules for some times the most “logical” question will come into your mind.

How I could define a uniform way of describing a behavior in terms of an interface and apply a ruling system upon it.

The above problem exactly is address by logic module. What it does ? First look at ILogicRule interface

publicinterfaceILogicRule

{

string ID { get; set; }

string ExecutionContextGroup { get; set; }

ViewType ViewType { get; set; }

Nesting Nesting { get; set; }

string Description { get; set; }

ITypeInfo TypeInfo { get; set; }

string ViewId { get; set; }

int Index { get; set; }

}

So given the properties of the above interface the logic system expects you to provide

1. A LogicAttribute derived class so you can apply it above your domain object classes

4.A LogicRulePermission derived class so you can control your behavior from the xaf security system

as you see all expected classes should implement the same interface such achieving polymorphism ..

So given that you have provided the above classes then Rule Logic system will attach to the events defined by the following contexts

[Flags]

publicenumExecutionContext

{

All=0,

ViewChanging=2,

ObjectChanged=4,

ObjectSpaceReloaded=8,

CurrentObjectChanged=16,

ViewControlsCreated=32,

ViewActivated=64,

ViewControlAdding=128,

TemplateViewChanged=256

}

and for the rule that are valid according to the ExecutionContextGroup and all other properties defined at I LogicRule interface it will provide a method within a controller to override and place your own logic for that spesific rule.

Sunday, March 14, 2010

I have been pretty silent the last few weeks , but I have not been lazy so eXpand has now many more modules and features that I am going to speak about in my next posts. A Logic Module has been implemented and that lead to some breaking changes to ModelArtifactState / AdditionalViewControlsProvider modules

Welcome to my Blog

My name is Apostolis Bekiaris and I am working for DevExpress as a technical evangelist for the frameworks team, .Net is my passion and at this blog you will find a lot of my work using DevExpress Xaf framework and many others. If you want to contact me you can use the link bellow