Sunday, December 31, 2006

The Initialize Pattern and the Open & Close Pattern


I have often been confronted with the "initialize" pattern or the "open and close" pattern. For instance there is some object that you instantiate but before you use it you must call an initialization method often like SomeClass.Initialize(). A similar pattern is that with objects that you need to open before usage and make sure that they are closed on usage completion. Often the situation can be handled using "acquisition is initialization". This works well with exceptions and stack unwinding. Sometimes the use of factories can meet the needs. I have a solution that is based on both and is a pattern that I have used when necessary.


In C# I use two classes an outer class and an inner class. The outer class's methods do not have public visibility, except for the constructor and a factory method. The inner class exposes the methods that can be performed on the outer class.


using System;
using System.Collections.Generic;
using System.Text;

namespace NestedTypes
{
public class CResource
{
public CResource()
{
}

protected void Open()
{
}

protected void Close()
{
}

protected void Read()
{
}

protected void Write()
{
}

public CResourceUser CreateUser()
{
return new CResourceUser(this);
}

public class CResourceUser : IDisposable
{
protected CResource resource;

internal CResourceUser(CResource resource)
{
this.resource = resource;
this.resource.Open();
}

public void Dispose()
{
this.resource.Close();
}

public void Read()
{
this.resource.Read();
}

public void Write()
{
this.resource.Write();
}
}
}
}



In this case I have the inner class implement the IDisposible interface which allows for the "using statement" in C#.


using System;
using System.Collections.Generic;
using System.Text;

namespace NestedTypes
{
class Program
{
static void Main(string[] args)
{
CResource resource = new CResource();
CResource.CResourceUser resourceUser = resource.CreateUser();
using (resourceUser)
{
resourceUser.Read();
resourceUser.Write();
}
}
}
}



I have used this pattern for implementing logging facilities. I have used this pattern in multi-threaded environments and I have found that this pattern made it obvious where synchronization must be handled.

Monday, December 18, 2006

Leader and Follower

In order to justify the risk in pursuing a course the leaders and the followers must:
1) Believe in the cause
2) Trust that there is an opportunity for success
3) Believe that the outcome is worth the cost
4) Believe that upon success he will receive his reward

The cause has to be motivating and be aligned with one's goals, responsibilities, or beliefs. The cause should be fully disclosed naming all parties and interests concerned.

There needs to be a real opportunity to succeed. For the follower success includes the allowance to act in the best manner, using one's faculties and skills, being respected, and having a voice that is heard. For the leader success includes the trust that the followers will act in the best manner, using their's faculties and skills, showing respect, and speaking when something needs to be said. The followers will do what they agreed to do and the leaders will do likewise.

There must be a belief that the outcome is worth the cost.

There must be a belief that at the journeys successful end that you will receive your wages. The follower expects the leader to reward them as agreed and that the leader will protect the follower's interests. The leader is in a position of trust and can not violate that trust by hiding the full agenda or by bowing to the interests of unnamed or undisclosed parties.

Wednesday, December 13, 2006

Agile is not about doing as little as possible.

If Agile is about doing as little as possible then I do not practice Agile.

From my understanding Agile reviewed practices and ceremonies and decided that many of them were out dated or not applicable in areas where change occurred often.

The goal is to do only the necessary work with enough staff to handle the necessary tasks. If that means doing less then so be it, but it might mean doing more. Understand that it depends on each situation, organization, and environment. I am sorry that it isn't as simple as you hoped.

Leading and Leadership

Leading as in "being in front of" is not necessarily Leadership.

"Apple is leading the market in the sales of high end MP3 players"
"The University of Utah is leading the way in computer graphics research"

Leading is similar to magnitude while Leadership is like a direction, or Leading is about how far you are in front and Leadership is concerned with going in the right way.

Sunday, December 10, 2006

Common Sense

Maybe the thoughts contained in the following lines aren't generally excepted or understood enough to gain general approval. It seems to be human nature that if over a long period of time something isn't challenged as being wrong or inefficient then the thing is accepted as being right or optimal. Any challenge to the long standing "thing" is usually at first met with resistance, but soon the commotion settles down and reason prevails.

Long experience and empirical evidence of inefficiencies, failures, and abuses is sufficient reason to question the correctness of business management organization and process. These problems have caused people at all levels in business to question the generally accepted "ways" of managing and organizing a business.

In this paper, I have avoided singling out any one management model as being good or bad, or any business leader as being good or bad. Those that have championed change do not depend on the success of my ranting. Also, in this paper, the arguments of those who prefer the status quo will ultimately be forgotten if there is not too much consideration given to their defensive remarks.

The cause of the Worker is, in a great measure, the cause of all people. Many circumstances have, and will arise, which are not specific to a business sector or management style, but are universal, and through which the principles of all those that desire the satisfaction of a "good days work" are affected, and because they are affect by these universal circumstances they are also rightly concerned. The using of employees in such a manner that they are nothing more than a resource, like so much cattle, which destroys self worth and self esteem and ultimately works against a business' need for efficiency and profitability is the concern of every employer and employee that has the capacity of reason.

The Origin and Design of Popular Business Organization and Process.

SOME writers have so confounded the concept of Team with the management organization, as to leave little or no distinction between them. They are not only different but have different origins. A Team is the organizational results of real need. Management organization is an attempt to deal with our weaknesses and pride. A Team promotes the happiness of each member by uniting on goals and needs where management organization is to minimize the negative affects of human vices. Teams encourage working together with a common cause while management organization creates distinctions, distinctions that have no correspondence with business efficiency or profitability. Team-ship is a patron. Management organization is a punisher.

Team-ship, community-ship, sociocracy, or whatever the term, is a blessing, but the common management organization of business in its best state is but a necessary evil in its worst state an intolerable one; for when we suffer, or are exposed to the same miseries by a business organization, which we might expect in a business with no organization or chaos, our calamities is heightened by reflecting that we furnished the means by which we suffer. High ceremony business organization, like government, is the badge of lost innocence; the mansions and estates of CEOs are built on the ruins of the humble home with the white picket fence and have redefined the organization of the family unit. If the intrinsic desires of a clear conscience were obeyed then there would be no need for another set of guidance. Since that is not the case, it is necessary to surrender up a part of the business earnings to furnish a means for the protection of the rest; and this is induced by the same prudence which in every other case advises one to choose the lesser of two evils. Wherefore, security and predictability being the true design and end of business organization, it unanswerably follows that whatever form thereof appears most likely to ensure it to us, with the least expense and greatest benefit, is preferable to all others.

In order to gain a clear and just idea of the design and end of a business organization, let us suppose a small number of persons start a new company, unconnected to existing companies. In this state of natural liberty, team work will be their first thought. A thousand motives will excite them thereto, the strength of one man is so unequal to his wants, and his mind so unfitted for perpetual solitude, that he is soon obliged to seek assistance and relief of another, who in his turn requires the same. Four or five united would be able to found a fledgling company, but one man might labor out the common period of a life without accomplishing any thing; when he had envisioned the business opportunity he could not bring it to market in a timely manner; the continuous burn of capital would drive him to more short term ventures, and every different want call him a different way.

Thus necessity, like a gravitating and organizing power, would soon form our newly found company into a team or society, the reciprocal blessing of which, would supersede, and render the obligations of corporate government unnecessary while they remained perfectly just to each other; but as nothing but heaven is impregnable to vice, it will unavoidably happen, that in proportion as they surmount the first difficulties of team work, which bound them together in a common cause, they will begin to relax in their duty and attachment to each other; and this remissness, will point out the necessity, of establishing some form of organization to supply the defect of moral virtue.

Some convenient empty office will afford them a conference room in which every employee of the company may assemble to deliberate on company matters. It is more than probable that their first by-laws will have the title of "company guidelines", and be enforced by no other penalty than company-wide disesteem. In the first company organization every man, by natural right will have a seat.

But as company portfolio and employment increases, the company concerns will increase likewise, and the distance at which the members may be separated, will render it too inconvenient for all of them to meet on every occasion as at first, when their number was small, their offices near, and the company concerns few and trifling. This will point out the convenience of their consenting to leave the business management part to be managed by a select number of chosen from the whole body, who are supposed to have the same business concerns at stake which those have who appointed them, and who will act in the same manner as the whole body would act were they present. If the company continues to grow, it will become necessary to augment the number of representatives, and that the interest of every part of the company may be attended to, it will be found best to divide the whole into convenient parts, each part sending its proper number; and that the elected might never form to themselves an interest separate from the electors, prudence will point out the propriety of having elections often; because as the elected might by that means return and work again with the general divisions of the company in a few months, their fidelity to the company division will be secured by the prudent reflection of not making themselves a permanent authority. And as this frequent interchange will establish a common interest with every part of the company, they will mutually and naturally support each other, and on this (not on the unmeaning title of CEO/President) depends the strength of the company, and the happiness of the employee.

Here then is the origin and rise of business organization; namely, a mode rendered necessary by the inability of moral virtue to govern the company; here too is the design and end of business organization, that is to say., predictability and security. And however our eyes may be dazzled with snow, or our ears deceived by sound; however prejudice may warp our wills, or interest darken our understanding, the simple voice of nature and of reason will say, it is right.

I draw my idea of the form of business organization from a principle in nature, which no art can overturn, that is to say., that the more simple any thing is, the less liable it is to be disordered, and the easier repaired when disordered; and with this maxim in view, I offer a few remarks on the so much boasted high ceremony organization of most businesses. That it was noble for the dark and slavish times in which it was erected is granted. When the world was overrun with tyranny, child labor, etc., the least therefrom was a glorious rescue. But that it is imperfect, subject to convulsions, and incapable of producing what it seems to promise, is easily demonstrated.

Absolute leadership through a single office (though the disgrace of human nature) has this advantage with their kind, that they are simple; if the company suffers, they know the head from which their suffering springs, know likewise the remedy, and are not bewildered by a variety of causes and cures. But the corporate politics of high ceremony business organization is so exceedingly complex, that the company may suffer for years together without being able to discover in which part the fault lies, some will say in one and some in another, and every new management fad will advise a different course of action for remedy.

I know it is difficult to get over local or long standing prejudices, yet if we will suffer ourselves to examine the component parts of high ceremony business, we shall find them to be the base remains of two ancient tyrannies, compounded with some new republican materials.

First.- The remains of monarchical tyranny in the office of the CEO and other Chief positions

Secondly.- The remains of aristocratical tyranny in the offices of the Executive committees, such as Vice Presidents and Directors.

Thirdly.- The new republican materials, in the persons of the committees, offices, and middle management.

The two first, by being appointed by the Board of Directors or the CEO, are independent of the employees and their business duties; wherefore in a constitutional sense they contribute nothing towards the representation of the needs of the divisions of the company.

To say that the organization of the company is a union of three powers reciprocally checking each other, is farcical, either the words have no meaning, or they are flat contradictions.

To say that the Board of Directors es a check upon the CEO, presupposes two things.

First.- That the CEO is not to be trusted without being looked after, or in other words, that a thirst for absolute power is the natural disease of autocracy.

Secondly.- That the Board, by being appointed for that purpose, are either wiser or more worthy of confidence than the CEO.

But as the same business organization which gives the Board a power to check the CEO by withholding the supplies, gives afterwards the CEO a power to check the lower managers and committees, by empowering him to reject their other bills; it again supposes that the CEO is wiser than those whom it has already supposed to be wiser than him. A mere absurdity!

There is something exceedingly ridiculous in the composition of high ceremony business organization; it first excludes a man from the means of information, yet empowers him to act in cases where the highest judgment is required. The state of a CEO shuts him from the world, yet the business of a CEO requires him to know it thoroughly; wherefore the different parts, unnaturally opposing and destroying each other, prove the whole character to be absurd and useless.

Some writers have explained high ceremony business thus; the CEO, say they, is one, the employee another; the Executive committee are an house in behalf of the CEO; the middle managers in behalf of the people; but this hath all the distinctions of an house divided against itself; and though the expressions be pleasantly arranged, yet when examined they appear idle and ambiguous; and it will always happen, that the nicest construction that words are capable of, when applied to the description of something which either cannot exist, or is too incomprehensible to be within the compass of description, will be words of sound only, and though they may amuse the ear, they cannot inform the mind, for this explanation includes a previous question, that is to say. How came the CEO by a power which the company is afraid to trust, and always obliged to check? Such a power could not be the gift of wise people, neither can any power, which needs checking, be from God; yet the provision, which high ceremony business makes, supposes such a power to exist.

But the provision is unequal to the task; the means either cannot or will not accomplish the end, and the whole affair is an act of suicide; for as the greater weight will always carry up the less, and as all the wheels of a machine are put in motion by one, it only remains to know which office in the company has the most weight, for that will govern; and though the others, or a part of them, may clog, or, as the phrase is, check the rapidity of its motion, yet so long as they cannot stop it, their endeavors will be ineffectual; the first moving power will at last have its way, and what it wants in speed is supplied by time.

That the CEO is this overbearing part in high ceremony business organization needs not be mentioned, and that it derives its whole consequence merely from being the giver of places pensions is self evident, wherefore, though we have and wise enough to shut and lock a door against absolute power, we at the same time have been foolish enough to put the CEO in possession of the key.

The prejudice of business men, in favor of their own corporate government by CEO, Board of Directors, and Executive committees, arises as much or more from personal pride and self serving ambition than reason. Individuals are undoubtedly safer and treated more fairly than in the Industrial revolution, but the will of the CEO is as much the law of the land in Toyota as in Ford.

An inquiry into the organizational errors in high ceremony form of corporate government is at this time highly necessary; for as we are never in a proper condition of doing justice to our work, while we continue under the influence of some leading partiality, so neither are we capable of doing it to ourselves while we remain fettered by any obstinate prejudice. And as a man, who is attached to a prostitute, is unfitted to choose or judge of a wife, so any prepossession in favor of a rotten high ceremony form of corporate government will disable us from discerning a good one.

Thank you Thomas Paine.

Thursday, December 07, 2006