If you are familiar with the DevExpress eXpressApp Framework, than you may have already run into this issue and this will be a great tool for you.  If not, the DevExpress eXpressApp Framework provides a great tool for modeling and opening up your data.  Whether in-house or on a consultant level you will likely benefit from using a tool like this in order to speed up your development cycle and get better products to your customer as quick as possible.

Assuming you have used the XAF framework and a XPCollection to make an association to objects, you may eventually run into a situation where a XPCollection has too much data.  Whether you have an association that is too big, or you are getting a collection of objects to process them and crunch some numbers, the collection itself does load all objects into memory and will likely bottleneck you at once point or another.  To work around this, DevExpress has introduced an object called the XPCursor.  The XPCursor allows you to give a persistent object a page size and still use the sorting and criteria collection.

How to use the XPCursor

To create an XPCursor, you would instantiate it just like you would a normal XPCollection, providing the criteria and the object type.

XPCursor xpcOrders = new XPCursor(typeof(Order),new BinaryOperator(“Date”,Today,GreaterThan));

This will return you back a cursor object which you can then set the page size on using the following piece of code:

xpcOrders.PageSize = 100;

At that point you can iterate through or hit that collection just like any other collection.  The advantage to using this, is that it will page out only to the records you need.  This means that if you are in a For Each loop and you are going through all the records, as soon as you get to record number 101 the collection will automatically load the next 100 records and release the first 100. If you had a record count of 100,000, loading a XPCollection would load 100,000 records as soon as you access it, whereas the XPCursor object would only load 100 records if that was your page size.

Cheers!

Something that I have always enjoyed working with is the exchange web services notifications engine.  This process not only allows you to jump in and fetch information from exchange through the exchange web services but it also gives you a nice subscriber model for responding to any exchange events.  This includes things like emails being received in a specified folder, or calendar entry changes, etc.  What I would like to show you is a quick overview of how the exchange notifications can be grabbed and utilized for whatever you so desire.  In my specific example I am grabbing email notifications and handling them with some business logic to assign them to cases in a help desk system.

Exchange Web Services Notifications – Fetching an event

Our first step is to create an exchange web service object that holds the URL to our service:

Dim excExchangeService As New ExchangeService(ExchangeVersion.Exchange2010)
excExchangeService = New ExchangeService(ExchangeVersion.Exchange2010)
excExchangeService.Url = New Uri(_mExchangeURL)

At this point we subscribe to the event that we awant to grab, and run a loop to hit it until we have events:

While True
  Do
    gerResult = plsSubscription.GetEvents()
    For Each ntfEvent As NotificationEvent In gerResult.AllEvents
      If TypeOf ntfEvent Is ItemEvent Then
        ..Handle notification event
      End If
    Next
  Loop While plsSubscription.MoreEventsAvailable
End While

Exchange Web Services Notifications – What do I do with an item once I have it?

Each event will be typed as either an item type specific to the folder or location that you setup your pull to pull from. In my specific example I setup a few timers to listen to email boxes and waited for the events to come in. When they come in I get an email item so I call the EmailMessage.Bind method to bind an Email object and read some information about the email.

A big push in .NET and software development in general is to move away from a service based process that reads every 5 minutes and sends updates and move into more of a reactionary event driven approach.  This is the best of both worlds, as you do not have to have an event driven model but at the same time your timer is not reading every certain time period and pulling in information.  By providing a real-time system that reacts to events we can tightly integrate our applications with the exchange processes.

Exchange Web Services Notifications provides not only a place for you to hook into great events from the exchange process, but an excellent object model for retrieving any information you need about exchange.

Microsoft Office to be given open source standards

Here’s some great news for Microsoft users: the next version of Office has been altered to include open source technologies. The company have opened up Microsoft Office 2013 to fully support the Open Document Format, for PDFs and variants of Open XML. According to Jim Thatcher, principle program manager lead for Office standards, the next version of Office “will support strict Open XML and Transitional Open XML, ISO 32000 (PDF) and OASIS ODF 1.2.” This move could have been due, in part, to the fact that both LibreOffice and OpenOffice have both been backed by ODF for a while, which may have put pressure on those in charge of Microsoft Office.

The movement towards open ODF has not been a fast process. It has been simmering along for around six or seven years, so the fact that it has now come to fruition is an exciting development. Many technology fans, who like to code their own applications or simply play online games like partypoker, should see the benefits in Microsoft’s Office being opened up to these sorts of technologies.

Electronic paper archives have increasingly come into focus over the years and now it is very useful to be able to have access to them. As well as this, Thatcher has talked about Microsoft’s plans to make it so that PDF’s can be edited as though they are Office documents. This is being called the ‘PDF reflow’ and would mean a drastic change in the way people work with PDF documents and the features that they boast. Thatcher has made it clear that this is not designed as a replacement to Adobe Reader or Acrobat, however it will no doubt prove to be very useful.

Office 2013 is expected to be formally launched in early 2013, however a fixed date has not yet been set.

Well, what a touchy subject this might be to some people.  I have always seen the battle go back and forth between Windows, Macintosh and Linux.  Windows being a middle-tier price range which excellent performance, Macintosh being the high end simply from marketing and Linux being the low end cost point which the most potential.  The problem I have always seen is that Microsoft holds the middle share which is always the most used share.   I have been a Microsoft developer for my entire career and I love it to death, but the power behind a Linux machine is starting to become hard to ignore.  Recently I ran into a project that was faced with spending 100 hours developing a communication platform for a piece of software or somehow getting .NET hooked into a Linux server.

Of course we went both routes as with any project whichever option is the best is the choice, but something has to work.  I came across this plugin for Apache and Linux called Mono.  Mono is a plugin/server application that lets you run ASP.NET applications on your Linux server native.  You do not have to get pushed to another server or lose your performance, you simply install the package and configure it in Apache and you are up and running.  To start, here is the mono website for you to check out and hopefully spread out through all of your Linux servers: http://www.mono-project.com/Main_Page

Hopefully you all install it and configure it so when I come through I can install my applications on your server and be just fine and dandy, if you don’t I will no doubt make you do it :)  There is a set of install instructions for each server type including Mac servers as well as CentOS, Ubuntu, Debian, etc.  Mostly it seems to just be a package installation through w-get or whatever your package flavor is.  After configuration you can use this site to configure virtual directories: http://go-mono.com/config-mod-mono/Default.aspx

The nice thing about this configuration generator is that you can create a separate config file for each virtual directory and include them in your base httpd config file under each virtual host settings section.  It is almost exactly like creating virtual applications in IIS and the performance is for the most part the same.  From what I have seen this far, .NET 4.0 is supported as well as AJAX, and I am hoping to see some more stuff go into the project to make it a viable option for hosting .NET applications.  Cheers!

Sponsored Links