20 July 2012

Under or over-engineering?

Whenever you see classes called controler, provider, decider, manager, presenter, etc. which reassembles to some managerial job, you know that it isn't truly object oriented. It is actually procedural way of thinking, just packed in classes.

I just saw a class called ColorDecider, which has one public method, two private ones and no state at all. The only job of this class is to decide which color should be chosen based on the state of some other object. It is actually a replacement for a switch or dictionary in that object. It does the same job, but it looks smarter. Not for me.

But it has an interface, because it is nice thing to have. There are no other classes which implement this interface, because there can be only one way of presenting data in the system in one time, and it is defined by requirements. This behavior will be changed only if requirements change one day. So, why it needs a whole class?

17 July 2012

A Cross-Thread Exception in DevExpress XPO

A cross-thread exception will happen every time you want to access a Session from different threads in the same time.

With the latest changes, DexExpress' Session introduced a Thread Watch object. His sole purpose is to check which thread tries to access a Session when it is about to chage it state from empty or to either GetObjectsNonReenterant or CommitTransactionNonReenterant state. If it is the different than the previous one, it will throw an InvalidOperationException exception.

Once the thread leaves the Session, Thread Watch will clear its state, so new thread can access it again.

Basically, it means that you have to use a single thread throughout the lifecycle of the Session object. You could, however, use more than one thread, as along as you use them sequentially, one after another. But, I believe that it would, if it isn't already naturall for your application, bring more troubles than benefits.

There is an option left to turn off this explicitly checks, by setting DevExpress.Xpo.Helpers.SessionStateStack.SuppressCrossThreadFailuresDetection to True, but it not advisable since it will just hide the real source of the problem.

31 January 2012

Teamplifier

Teamplifier is small, off-side, project done in a free time by two members team in Belgrade. But, if I didn't tell you, you would never guess it was the case as it looks like a product of much bigger and expensive team. Although it is in beta phase and some of planned features are still missing, you can already feel the main idea behind it: small and lightweight web based project management tool aimed for small teams, freelancers and entrepreneurs.


It is extremely easy, in only few steps, to kick-start a project. Each project consists of more tasks in different stages. By advancing tasks you keep a track of a project progress, until it ends naturally. Beside projects itself, you have to define users and groups, each with its own settings. And that's all. No complicated rules, workflows and meaningless features. That is exactly what is expected from the ultimate project management tool for small organizations, to be there to help in turbulent and dynamic environments, but not distract processes by imposing its own rules and regulations.

And the best feature of all: it is completely free.

31 May 2010

PST Data Structure View Tool

PST Data Structure View Tool: "PST Data Structure View Tool (PSTViewTool) is a tool supporting the PST file format documentation effort. It allows the user to browse the internal structures of a PST file."

More about structure of a PST file: Outlook Personal Folders File Format (.pst) Structure Specification

22 January 2010

Use embedded IE in FHP to show Office documents

You can use embedded Internet Explorer control, hosted by FHP, to show Office documents. But, by default, IE will open them as read-only, even if they are local files. If you are using SharePoint server, you can notice that it opens Office documents as read/write in that case.
So, in order to resolve this behavior so that IE opens documents that are in the Internet or Local intranet security zones with read/write permissions, you must add the following registry key:

• For Office XP
HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\Internet\OpenDocumentsReadWriteWhileBrowsing = 1

• For Office 2003
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\Internet\OpenDocumentsReadWriteWhileBrowsing = 1

• For the 2007 Office system
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Internet\OpenDocumentsReadWriteWhileBrowsing = 1

11 December 2009

PIA for Office 2007 and VSTO 3.0 Improvements

- Richer support for Outlook Object Model; twice larger, with 85 classes included.
- Performance improvements. Introduced new Table object for faster accessing items and properties and PropertyAccessor for faster property access.
- Richer security model and in some cases simpler appliance. Application object within add-in is trusted as safe by default.
- New forms regions which can be added in Explorer and Inspector to show more properties of displayed item.
- New ribbons can be added.
- Some of context menus are allowed to change.
- Access to Outlook Rules.

03 December 2009

Security and FHP

User control which is embedded in Folder Home Page must be registered as COM object and marked as Safe for Scripting. This is done automatically by Visual Studio during debugging but must be set manually in installer if you want installed application to work properly.

Outlook 2007 has strengthened security model from 2003 version - it will not allow custom FHP for non-default PST file. If you have additional PST file, beside default one you have to allow it by setting this key in the registry to 1:

HKCU\Software\Microsoft\Office\12.0\Outlook\Security\NonDefaultStoreScript