Παρουσίαση με Ετικέτες

Xaf Tip # 7 Dangerous Switch
24 Σεπτεμβρίου 09 03:09 πμ | tolisss | 0 σχόλια   
My good friend Martin Praxmarer while we are working on some cool feature for the new ModelDifference eXpand module pointed out the existence of an evil switch Suppose your team is responsible for creating a module with some kind of Permission so when the system is granted that permission a block of code will be executed, something like if (SecuritySystem.IsGranted( new MyPermission())){     //do something } and then you pass your module to another team or another consumer and he decides to use the “EVIL ONE” property that is exposed by DevExpress.ExpressApp.Security.SecurityBase class is name IsGrantedForNonExistentPermission and can be changed easily as shown in the next image What it does? As its name states inverse the behavior of the SecuritySystem.IsGranted

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , ,
How to zero your application startup time
21 Σεπτεμβρίου 09 11:10 μμ | tolisss | 0 σχόλια   
For this question don’t we all of us spend a lot of time ? But I think it is allowed to use a trick to spend our selves that time. Add to your model to attributes NotifyIcon, MinimizeOnClose. Since I am using Xaf I am going to present that with it but the code should be very similar to any other windows application so here are our attributes NotifyIcon: will add a tray icon for your app at the system tray with a context menu that will allow you to terminate your application and display it when you double click the icon public   partial   class NotifyIconController : WindowController {     public   const   string NotifyIconAttributeName = "NotifyIcon" ;     public NotifyIconController()    

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , ,
Xaf tip # 6 Linq your Session queries
17 Σεπτεμβρίου 09 04:07 μμ | tolisss | 0 σχόλια   
Pretty silent these days eh? I am working on a big refactoring on DictionaryDifference and have not much time to blog. But have another tip for my Xaf Tips series today maybe not strictly Xaf but is an XPO tip that you can use with your Xaf applications . The Problem Suppose your are a strongly typed fun like me or you want to use linq to query objects inside a transaction. In order linq to be used with XPO DevExpress provides XPQuery<T> class but unfortunately this do not support transactions. So the following test fails var work = new UnitOfWork(); new User(work){UserName = "Sam" }; User firstOrDefault = new XPQuery<User>(work).Where(user => user.UserName == "Sam" ).FirstOrDefault(); Assert.IsNotNull(firstOrDefault); The solution

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , ,
I now am a DX-Squad member
12 Σεπτεμβρίου 09 01:49 πμ | tolisss | 0 σχόλια   
Great Saturday today cause I just received my DX-Squad membership today :) and I am very happy. I wanted to say a big thanks and that i am honored by that invitation. DX-Squad is a similar program than Microsoft MVP. If you want also to be a member read more about it here

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία:
ModelArtifactState Xaf Power to the people
02 Σεπτεμβρίου 09 11:34 μμ | tolisss | 0 σχόλια   
Yesterday i was speaking with my friend John Pouliezos and he asked me how to the implement the following  scenario. John has managed to create a SharePoint feature and now he can have Xaf views as SharePoint lists. Cool eh? What he wanted is the following: for specific User roles to be able to filter a specific web listview by parsing the current browser url. Step1 : for specific User roles to be able to filter a specific web Aha sounds like ModelArtifactState’s job a lot. Cause that module is able to enable or disable behaviours /controllers (doing something) using permissions or the model. We are going to use permissions for this one So no code is needed for step1 ModelAsrtifactState module is going to help us. Step 2 : John explain to me the urls are

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , ,
Firefox is DevExpress friendly
26 Αυγούστου 09 12:56 μμ | tolisss | 0 σχόλια   
Did you now that there is a DevExpress search engine provider for FireFox? http://mycroft.mozdev.org/search-engines.html?name=devexpress Just install that beauty and every time you want to search something by using this excellent post Master the Firefox search engine bar with keyboard shortcuts use your keyboard press some keys and you are searching DevExpress Technorati Tags: FireFox , DevExpress

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: ,
ModelArtifact AdditionalViewControlsProvider And MasterDetail videos republished
25 Αυγούστου 09 02:23 μμ | tolisss | 0 σχόλια   
Since I got many complaints about the low resolution of my videos I am on a search for a better video hosting service than YouTube. Robert suggested to use Silverlight service at Blogger Video embedding resolved but this one looks the same as YouToube. After spending some more time on researching on this I came across http://blip.tv/ excellent hosting service To get an idea how good they are I suggest you read their FAQs They accept almost all kinds of  Videos They are free They do not change the video after uploading The customization of the video playback controls is unlimited . You can configure almost anything on their well design interface I am going to use that excellent service to republish my videos So if you want to see those videos again in good

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , , , , ,
Xaf tip # 4
21 Αυγούστου 09 02:18 μμ | tolisss | 0 σχόλια   
This is my 4th post on my Xaf tips series Runtime Member creation on TypesInfo and XPDictionary When you are developing modules and need to generate runtime member you should be carefull which method you choose because the following is valid always Assert.IsNull(XafTypesInfo.Instance.FindTypeInfo( typeof (Country)).CreateMember( "TestMember" , typeof ( string ))); and this one not Assert.IsNull(XafTypesInfo.XpoTypeInfoSource.XPDictionary.GetClassInfo( typeof (Country)).CreateMember( "TestMember" , typeof ( string ))); So to test my sayings create a new Xaf Application add a controller and call public   override   void CustomizeTypesInfo(ITypesInfo typesInfo){     base .CustomizeTypesInfo(typesInfo);    

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , ,
Bend Xaf Applications with Model Artifact State Module
17 Αυγούστου 09 11:07 πμ | tolisss | 0 σχόλια   
How many times have you said “What a great pattern MVP is!!!” Look for example how is implement the hint engine of main Xaf demo. I will try to explain that implementation. Controllers There is a windowcontroller called AdditionalInfoController and from it 2 controllers derive WebShowAdditionalInfoController and WinShowAdditionalInfoController. What they do? they enable inserting any kind of control as the first control of a view. They are the engine, they implement a behaviour and they also serve as the Observer design pattern Observer pattern: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. I am going to refactor the code from the main demo and create 3 new modules

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , , ,
Implementing Master-Detail with No Code
13 Αυγούστου 09 11:31 μμ | tolisss | 0 σχόλια   
  eXpand already has this scenario enabled for windows forms applications. What you have to do is set 2 attributes and you are done!!! You have force your grid to display a child grid view eXpand is hosted at http://code.google.com/p/expandframework/ Technorati Tags: expand , DevExpress , Xaf

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , ,
Favor composition over inheritance
09 Αυγούστου 09 05:15 μμ | tolisss | 0 σχόλια   
There is a software design principle that states “ Favor composition over inheritance ” Inheritance is a cool way to change behavior. But we know that it's brittle, because the subclass can easily make assumptions about the context in which a method it overrides is getting called. There's a tight coupling between the base class and the subclass, because of the implicit context in which the subclass code I plug in will be called. Composition has a nicer property. The coupling is reduced by just having some smaller things you plug into something bigger, and the bigger object just calls the smaller object back. From an API point of view defining that a method can be overridden is a stronger commitment than defining that a method can be called. That Principe my friends

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , ,
Xaf tip #2
02 Αυγούστου 09 11:09 πμ | tolisss | 0 σχόλια   
Just come back from my short holidays this year and I am feeling very relaxed. So I though I should continue my Xaf tips series as I encounter them in my every day work. Be carefull of DevExpress.ExpressApp.DC.TypesInfo.FindTypeInfo method I am only going to say that each time you call the above method if the typeInfo that you expect to get back is not redistered on the system, a new one is going to be created and returned to you. so typesInfo.FindTypeInfo(typeof(Person))!=typesInfo.PersistentTypes.Where(info => info.Type==typeof(Person)).SingleOrDefault() and for you to imagine any kind of conflict you like take into account that a new table named Person is going to be created at your db with the following line if (typesInfo.FindTypeInfo(typeof(Person))!=null)

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , ,
Continuous integration for eXpand
24 Ιουλίου 09 02:08 μμ | tolisss | 0 σχόλια   
First of all thank you very much for your good words in eXpand . I am going to continue releasing modules and the next one will be a big one so please bear with me. But since I am relasing a lot of code and some other developers contact me that they want to contribute also. I think its time to to move on to apply a more continous integration to our build proccess. What I mean by that? the paragraph bellow was takes from martinfowler.com The easiest way for me to explain what CI is and how it works is to show a quick example of how it works with the development of a small feature. Let's assume I have to do something to a piece of software, it doesn't really matter what the task is, for the moment I'll assume it's small and can be done in a few hours. (We'll explore

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , , ,
DxCore plugins for Xaf are moving
19 Ιουλίου 09 11:36 μμ | tolisss | 0 σχόλια   
I am realizing a new version of eXpand (0.0.0.7) that will contain a configurable low level datastore filtering provider module and I am going to merge Coderush plugins into it as well. You have to download latest version of eXpand from http://code.google.com/p/expandframework/downloads/list and add only the following assemblies into your community folder if you are not interested in eXpand  DevExpress.ExpressApp.ModelEditor.v9.1 eXpand.Utils Wintellect.Threading eXpandAddIns

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , , , ,
Xaf Exception Stack Explorer
10 Ιουνίου 09 09:07 μμ | tolisss | 0 σχόλια   
Xaf has its own tracking system enabled by default . What it does? It tracks almost every from exception to button clicks and object states!! What I want to saw you is how easy we can create a CodeRush addin that every time an exception occurs we could navigate through all the stack trace We will accomplish that using Resharper’s stackTraceExplorer . So all we need to do is to find startup project’s bin directory open expressAppFramework.log which is the file that Xaf writes all traces, find the last entry, copy it to memory and send to Visual studio a Resharper+ExploreStackTrace command Lets do it. In fact we can easily extend the plugins project I posted here and have all in one package. But we have to be careful when trying to read a log file cause it may

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , , ,
CodeRush plugins for Xaf
04 Ιουνίου 09 08:42 μμ | tolisss | 0 σχόλια   
Download sources (10/6/09) (see Xaf Exception Stack Explorer ) ProjectConverter Browsing and downloading from Devexpress support center often I find old projects with broken references Old days when i see broken references at my solution due to version changes I had to go to my C:\Program files\pathToYourProjectConverter executable. Open it, browse to find my solution folder and convert it Nowadays I am using a small CodeRush addin I wrote and I can convert any solution from with in Visual Studio By pressing a shortcut. You have to configure it by setting its path as shown in the image bellow if you use a recompile version of the assemblies you can also set at the PublicToken field Then you go to shortcuts and assign a shortcut key for the convertProject command

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , , ,
Validation Rule: At least one property is required
03 Ιουνίου 09 01:33 πμ | tolisss | 0 σχόλια   
Today i stump again upon the same problem . I wanted to throw a validation exception only if both of my properties do not have value. So lets create a validation rule for this one. More info on how we create custom validation rules can be found here Validation Module Since we are talking about multiple property values i think we should go with an attribute that is applied to a class and not to a property. Ok first we have to define that both our RuleBaseAttribute and RuleBaseProperties derived classes will implement . public interface IRuleRequiredForAtLeast1PropertyProperties { string MessageTemplateMustNotBeEmpty { get; set; } string Delimiters { get; set; } string TargetProperties { get; set; } } ok that looks nice lets explain what we have here for a bit.

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , ,
Automatic properties for Xpo
02 Ιουνίου 09 05:23 πμ | tolisss | 0 σχόλια   
  The problem Xpo in order to support transactions implements some special kind of property setters like private string lastName; public string LastName { get { return lastName; } set { string oldValue = lastName; if (oldValue == value) return; lastName = value; OnChanged("Name", oldValue, value); } } Or a little more elegant like private string lastName; public string LastName { get { return lastName; } set { SetPropertyValue("LastName", ref lastName, value); } } Imagine you want to Design a fairly simple model like Customer –> Orders. A Customer should have LastName, FilrstName, Age and Orders as properties and Order only an Amount property. Using the above approach one could write the following code to describe the above model.

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , , , ,

Search

Go

Το Ιστολόγιο

Ιστορικό Δημοσιεύσεων

Συνδρομές