BizTalk Blog by Chris Han

BizTalk, ASP.NET, C#, SQL server, Visual studio

  Home  |   Contact  |   Syndication    |   Login
  62 Posts | 9 Stories | 84 Comments | 82 Trackbacks

News

Article Categories

Archives

Post Categories

Image Galleries

BizTalk Bloggers

BizTalk on MSDN

Patterns & Architecture

SharePoint

Wednesday, August 13, 2008 #

Beijing 2008 Olympic has started with a magnificent opening ceremony. All the doubt about the aggressive construction projects suddenly disappear like Beijing’s smog.
An article ‘(Projects) Made In China’ by Janet Carmosky and Bill Lonergan on March 13, 2008 describes how the projects were managed by Chinese project managers. They also state that the leaders of China’s major projects are “the world’s most intuitive managers.”
Chinese are definitely falling behind westerns at scientific management. But is $34 billion spending the only reason that Chinese people can put all these together in time for the Olympic?
I fund a different angel in an interesting article 'How corporate China is evolving' by Andrew Grant from McKinsey. It unveils how Chinese CEOs do business, quote:
'Because the career of a typical CEO of a state-owned enterprise usually straddles the corporate and political spheres, these chief executives pay careful attention to politics—in particular, to developments in the Communist Party...'

'What’s more, the symbiotic relationship between the enterprise and the state makes such CEOs sympathetic to corporate social and economic goals beyond maximizing shareholder value.'

These explain why Chinese can achieve higher level goals even with not so good technologies and managerial techniques.
I’ve been involved in many ‘enterprise transformation’ projects. I find that the most effective way to align the objectives of department/sub-unit to the enterprise goals is to design a career system that promotes the leaders who can not only perform well at their unit but also carry out the corporate policies. If you think of the nation as an enterprise, isn’t it what Chinese government has been doing?
Lots of people asked why it happened after 9/11 attack. How many intelligent agencies do you need to stop it? The common agreement is that it is a ‘system failure’. In English, it failed at interfaces between departments. Do you think add another Homeland Security department above all will solve the problem? Perhaps it will help to make it hard for terrorists to execute another attack. But does it make hates disappear? Or isn't there a linkage between foreign policy and internal security strategy? I think Chinese government and Communist Party did a wonderful job in designing their organization which can pass along their policies optimized at nation-wide level. It takes motivated people to get things done, not another layer of control.

Chinese may be lack of managerial skills, but they are definitely not short of system thinking and motivation. As a matter of fact, you can find this kind of system thinking in many forms in Chinese culture. For example, in Chinese GO game, the goal is not to win at one or two spots on a 19x19 grid board. It’s actually all about strategic planning and win at large.
Needless to say, Chinese have more then enough resources to generate the motivation, from cultural proud, economical benefit, to personal career development, you can feel it every where if you've been there.

Tuesday, July 29, 2008 #

Poka-yoke (mistake-proofing) is a technique for mistake-proofing in process design. It's trading the flexibility for less variance. There is a similar concept in software called defensive design or defensive programming.

Yesterday, I just experienced a good example of how important defensive design is. I was trying to plug my external hard-drive to my laptop via USB port. As you know the USB port actually has some sort of defensive design - the connectors in the metal enclosure is actually located only at the lower half. It supposes you can not plug the male connector into it at all if flips it upside down. The problem I see is the implementation of this defensive design on my laptop. The plastic connector is not strong enough to proof a determined idiot like myself. The consequence is serious – the laptop’s power unit is damaged. I guess I have to change the mother board or rather throw away the whole laptop.

Am I too 'Paka' to be a good user? If you use DFMEA method to calculate a Risk Priority Number (RPN) in this case, I'd say hell no. It gets a pretty high score on my calculation:

Severity: 10
Occurrence: 2
Detect and prevent: 5
RPN = S*O*D = 100 

Although it's highly unlikely happens, it is sure one of the failure modes both hard to detect and cause fatal damage. I like the IEEE 1394 (Firewire) socket better at this account. Like at it shape - reduced occurrence; and it's metal - hard to push through. 

 PS. I just realized that USB has a Mini version. It's much closer to 1394's design idea. It's better.


Friday, July 18, 2008 #

I was working a project schedule with MS project. I started by estimate the duration in 'months' using PERT, and later I decided to switch to 'days'. The I run into the duration format convertion trouble. I fund the set the 'Duration is entered in' drop down list in option menu didn't really do the job. See the full solution:

geekswithblogs.net/chrishan/archive/2008/07/18/123879.aspx


Wednesday, February 06, 2008 #

I guess we all had a 'aha' moment when fund out what our friends talking about was just something you'd call it differently which made you totally missed out the first half of the conversation.
I sure had one - when my friend pronounced SOA as sooooa like in Noah. But that’s just the different of pronunciation. We can still communicate by writing SOA down.
What makes it more difficult to communicate is the definition of taxonomy, which is supposed to be a map. Here is an example we are facing in BPM today. I map the two sets of taxonomy hoping it’ll help in understanding and communicating BPM idea and development.

Academia
Industry
Used-to-be Product
Collaboration-Centric Process Automation
Document processes
Portal
People-Centric Process Automation
Human-centric BPM
Workflow
System-Centric Process Automation
Integration-centric BPM
EAI

Tuesday, February 05, 2008 #

This is part of my school work at Steven Institute of Technology. The assignment is to come up with a definition of a system architecture by my own words. Here it is: 

A system architecture is the organization of a set of components forming up a system. It provides a plan that arranges the responsibilities of each internal component in the system and their interactions to each other as well as the interactions between the system and the external environment it resides and/or being operated in.

A system architecture also refers to a set of artifacts by which the plan of the system can be communicated to each other among stakeholders.
 
A complete system architecture includes a methodology guiding the instantiation activities of the system which also rendering a consistent style among system instances.

The last point about methodology is what I learned from my work experience, and inspired by the architecuture from civile engineering.


Monday, January 14, 2008 #

 

 

I haven't written any thing for a while. Part of the reason is because I'm now back to school - Stevens Institute of Technology.

As my career advancing, I'm more and more focusing on Enterprise Architecture and Business Process Management. Of course, as an EA, you'll never hand off on technologies. So as a Microsoft guy, I'm always curious about what Microsoft will offer to BPM.

I'm a little suprised when I talk to my professor Dr. Michael zur Muehlen (his blog: bpm-research.com). He sees Microsoft as just a vender of System Integration Solution. And it seems Gartner is agreeing with him. Check out this gartner BPM Magic Quadrant 2007(free with registered user). I also find that Sandy Kemsley had a chance to closely examine Microsoft's tech stack, and shared with on her blog column2.com.  

But I still remain curious on what are the commonly agreed criteria of a qualified BPM solution. I agree that BizTalk is not a complete business architecting to automatic execution solution, but can we at least say it's a workflow system than a simply EAI/ESB? I mean, it got BPEL engine, rule engine, BAM....

Is that because the lack of 'human-centric' features that BizTalk is not recognized as a BPM player? I'll find out, later.


Tuesday, October 23, 2007 #

Here is how you should play it:
1. Make sure your have both a SQL 2000 with latest sp and a SQL 2005 database
2. guess the result of the two 'print' command in the script below, write down the last character in the string on your mind
3. Run the script below in SQL 2000
4. Change the 3999 to 3998 and run it again on SQL 2000
5. Change the 3998 back to 3999 and run it on SQL 2005

 ---------------------------------------

declare @n varchar(4000)

set @n = replicate(N'z',3999)+N'i'

print @n

set @n=replace(@n, N'i', N'B')

print @n

-----------------------------------------

have fun


Thursday, October 04, 2007 #

It used to be a joke when there was some software design flaws caught at the test phase. It is amazing to see that the joke presents a truth by reading this new from MSNBC http://www.msnbc.msn.com/id/21112810/

If you put the hybrid car as an architect, one of the most important questions you should have asked yourself as an architect is 'how it will interact with the environment it resides?'

You thought the noise of the gasoline car is something unwanted? Think again. It is really depends on which stakeholder you are talking about. Blind people are in deed participating in the traffic - the architectural environment your system interacts with. To them, the noise indeed is a feature!

Now ask yourself, do you think vibration is a feature of the car or rather a technical constraint?


Saturday, September 15, 2007 #

I'm running 64 bit Visa and trying to install my new phone toos software 4.5.1c. After get this error, I have to exchange the 4.5.1.c with a 4.5.  After install v4.5 and let it update itself to 4.5.1.c online, everything works.

Hope this will help ohters Moto owners.


Friday, September 14, 2007 #

I remember when the title 'architect' in IT became a buzz word around 2005, a fellow blogger comments that it is just a new way to say ‘I'm senior enough not to code any more’. It is a joke, a good one, if you don’t really understand what architecture is supposed to do with the system, and how you are supposed to make that happen.

Today, an even bigger title flowing around the job market – ‘Enterprise Architect’. What is that supposed to mean? A more senior-er position that you don’t have to code plus a c-level bonus?

Before you can call yourself an ‘Enterprise Architect’, you have to understand what an Enterprise Architecture is. The ‘architecture’ in system engineering perspective is a structure that defines its internal components and the relationship between the components, as well as the relationship to environment it resides. The ‘Enterprise Architecture’ comes from the theory that an organization (enterprise) is a system. Therefore it can be viewed as a structure that defines its internal components (functional departments or regional divisions) and the relationship between them (power and resource sharing, command chains), as well as relationship to its environment – political, environmental, competitive…

An ‘Enterprise Architect’ is a role who comes from engineering or science discipline with a good understanding of businesses and industries; who is responsible for over seeing the business as a system and design and govern it as such a system that can only gain its competitive edge by generating the output effectively and efficiently from its limited resources. It’s not a MBA, not an EMBA. It’s a system engineer at a larger, human-centered system.

Chris
http://www.stevens.edu/sse/


I read a piece of news online says Plymouth police officers in England make more arrests  and reduce violent crime by wearing a helmet mounted camera. (http://news.cnet.co.uk/camcorders/0,39029660,49287477,00.htm) By reading the news, it seems the idea of having cams attach to police officer’s helmets is another silver bullet to solve the serious crimes. Interestingly, the other night when I watch CNN tech news, a police officer being interviewed concludes at the end of the video footage with a big smile on his face “it saves us a lots of paper works”. It is amazing how system being viewed and used by different stakeholders. To the public or tax payers, it’s all about the purples of having police department; to the executives in department, it’s the numbers that make them valuable; to the first line officers, what makes it worth is the convenience of concluding his or her day by simply changing hat and enjoy more time with family.

Wednesday, July 18, 2007 #

I've been through almost all sorts of Timeout related issues with Asp.net web service development. I’d like put a check list here to remind myself and hopefully save some headache of yours.
 
  1. If use database, you may get ‘System.Data.SqlClient.SqlException: Timeout expired’:
          a: Check your connection string setting for ‘Connect Timeout’:  I.e.
    connectionString="Data Source=SNYC14D11511;Initial Catalog=d_dbivt003;Persist Security Info=True;User ID= user;Password= Password;Connect Timeout=4200

          b:Check your command object  SqlCommand.CommandTimeout Property, it’s by default 30s 
  2. Check you Web.config setting when you get error like ‘Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.’:
    <system.web>….
    <compilation debug="false"/>
    <httpRuntime executionTimeout="1200"/>
    </system.web>
    make sure your set 'compilation debug="false" as well to let timeout setting take effect. Check MSDN for details.
  3. Set your proxy class Timeout property (derived from WebClientProtocol.Timeout Property) at client if you get error like this ‘The operation has timed out’: I.e.
    proxy.Timeout = System.Threading.Timeout.Infinite;
  4. If you are like me, use VistualStudio unit test tool and you get a blue icon and error ‘Timeout’ in your test result pane, you need to check your test config file localtestrun.testrunconfig. The last item ‘Test Timeouts’ is the key. It’s 5 min by default. 
  5. Last one and every web developer should know is the IIS server setting such as Keep Alive and Connection Timeout

Thursday, June 28, 2007 #

I got this error when testing my web service POC which is runing on .netFx 2.0:

System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

I find Angel's article gives the most accurate diagnosis. Check it out here:
http://blogs.msdn.com/angelsb/archive/2004/08/25/220333.aspx

But the solution he gives out doesn't solve the problem:
      public void DoesNotLeakConnections()

      {          

                  Using (SqlConnection sqlconnection1 = new SqlConnection("Server=.\\SQLEXPRESS ;Integrated security=sspi;connection timeout=5")) {

                              sqlconnection1.Open();

                              SqlCommand sqlcommand1 = sqlconnection1.CreateCommand();

                              sqlcommand1.CommandText = "raiserror ('This is a fake exception', 17,1)";

                              sqlcommand1.ExecuteNonQuery();  //this throws a SqlException every time it is called.

                              sqlconnection1.Close(); //Still never gets called.

                  } // Here sqlconnection1.Dispose is _guaranteed_

      }


What you should do which is the best practice for any resource related job is to close the resource in a Final block like this:

 

      public void DoesNotLeakConnections()  

      {          

                  Using (SqlConnection sqlconnection1 = new SqlConnection("Server=.\\SQLEXPRESS ;Integrated security=sspi;connection timeout=5")) {

try

{

                              sqlconnection1.Open();

                              SqlCommand sqlcommand1 = sqlconnection1.CreateCommand();

                              sqlcommand1.CommandText = "raiserror ('This is a fake exception', 17,1)";

                              sqlcommand1.ExecuteNonQuery();  //this throws a SqlException every time it is called.

}

catch  (Exception ex)

{

  //do something

}

finally

 

 

{

          sqlconnection1.Close(); //Always gets called.

}

                  } // Here sqlconnection1.Dispose is _guaranteed_

      }


 


Monday, June 25, 2007 #

My friend told me this morning, he's little confused with his UPS shipment tracking result.

We all know that UPS' using 18 bits tracking number to 'uniquely' identify a shipment. But after I just saw my friend's tracking result page, I'm not sure about the 'unique' part any more.

On the 'Package Progress' pane, UPS lists all the history of the shipment associated with the number:

Package Progress
Location Date Local Time Description
BROOKLYN,
NY,  US
06/25/2007 9:47 A.M. DELIVERY
  06/25/2007 7:19 A.M. OUT FOR DELIVERY
BROOKLYN,
NY,  US
06/22/2007 11:38 P.M. ARRIVAL SCAN
FARMINGDALE,
NY,  US
06/22/2007 10:29 P.M. DEPARTURE SCAN
  06/22/2007 8:11 P.M. ORIGIN SCAN
CHARLOTTE,
NC,  US
11/06/2006 4:53 P.M. DELIVERY

See the two high-lighted lines? Apparently, the tracking number is reused by UPS! I don't what's the policy for reusing a tracking number at UPS. But the common sense would be unless you have used all other possible numbers, right? That means all 18 bits of numbers have been used in roughly half year (11/06/2006~06/25/2007)! That's 10^17*26= 2,600,000,000,000,000,000 shipments! Man, 2.6 trillion, what a business!

I guess it's a good news for sales department at UPS but headache for DBAs. Most our SQL server database are still using 'int' type as the unique id, which only supports 2^31-1 (2,147,483,647), even 'bigint' type which supporting up to 2^63-1 (9,223,372,036,854,775,807) - about 3.5 times of what UPS has used out in 6 months. It's about 1.7 yeas of OLTP data. After that, you have to move the data to a data warehouse! DBAs or database designer probably never think of such a big number in such a short time. Similar problem as Y2K, but this comes much quicker than any of us can ever imagine. Even Mr. Moore needs to adjust his law.

What a great time for all geeks like you who’s reading my blog. But be prepared! Love yo’ll.


Wednesday, June 13, 2007 #

I have to admit that I never read any manual or document for Visual Studio. Part of blame should go to MS engineers who design such a consistent UI that I can pick it up without any learning curve with past experience.
 
But this also creates a problem when there is a new element introduced in the newer version without a proper warning on the consequence. That is what happened to me.
 
If you right click an Aspx file in Solution Explorer, you will see an item called “Browse With” in the context menu.
I added Altova’s XML Spy to display the XHTML generated by Server side. But I forgot to set the “Default” back to IE after that. The consequence is that every time I try to F5 debug or View in Browser, Visual Studio will load the XmlSpy to display the XHTML generated by Server side instead of load it IE.