Monday, March 18, 2013

20 Rules of Software Consulting (by Josh Berkus)

The following is from http://www.databasesoup.com/2013/03/20-rules-of-software-consulting.html. Should review this rules frequently.


  1. Technology Reflects the Business: show me a client with a chronic software problem, and I'll show you a client with a chronic management problem.
  2. Three Things You Will Never See:
    a. A timeline which is too generous;
    b. A client who pays too quickly;
    c. An accurate and complete specification.
  3. Half of Applications Are Immortal: "temporary, one-off" applications often last for years, and there is code from the 1960's which is still running today. Always plan for longevity.
  4. Bad Clients Will Destroy Your Business: half of your success will be built on the ability of recognizing bad clients and avoiding them or terminating their contracts before they suck away all of your time and resources. Always be able to walk away, even if it means giving a refund.
  5. Ask Not What's Possible: the question is not what you can do, the question is how much the client is willing to pay for it and how long they will wait.
  6. Time Substitutes for Money on a Logarithmic Scale: e.g cutting the time by 20% will require doubling the budget. Cutting the budget by 30% will quadruple the amount of time.
  7. All Estimates are Optimistic: new application development will take three times as long as you expect, and cost twice as much. Or vice-versa.
  8. Three Things You Will Never Have Enough Time For:
    a) The specification and prototypes
    b) Documentation
    c) Code maintainability
  9. All Substantial Applications Have Platypuses, which are objects or bits of data which defy all attempts to fit them to well-defined business processes. Platypuses are both why perfect data integrity is unachievable, and the source of at least 30% of troubleshooting.
  10. Don't Call it Refactoring:  clients never pay for cleanup, even if that's what they need.  Figure out a way to call the refactoring something else so you can get it done.
  11. The Longer You Wait to Refactor, the Longer It Will Take. Major template or schema changes at production time are particularly deadly.
  12. Always Have a Contract, even for one-day jobs. Also, use your own contract, and not the client's, and have your contract written by a real attorney. It's worth it.
  13. The Contract-Writing Process Is a Litmus Test for Its Fulfillment. If the client spends a lot of time arguing over the contract, then actually working with them (or getting paid) will be even more difficult. If the client insists on an odd and obscure clause, they're planning to exercise it.
  14. The Client Has Very Poor Memory: no matter what they sign, the client will have forgotten what they agreed to within days, if not hours. Document all requests and changes and keep copies.
  15. Never Agree to a Fixed Bid for anything where you have not done the same exact task at least twice before.
  16. Third Parties are Incompetent: never agree to a fixed bid or success-based payment for any task which is even partially dependent on the speed, documentation or product quality of a third party not under your direct control. This means no fixed bids for data interchange or fixing other people's code, ever.
  17. The Client has No Taste: never allow the client to choose your tools, your subcontractors or your work environment. Or at least charge them a lot extra for the privilege.
  18. Always Bill for Meetings, or you will spend half your life attending them.
  19. A Half-Empty Mailbox Is The Exception: usually, if one client decides to pay unusually late in a month, all of your clients will. Always be able to survive 60 days on your savings.
  20. A Sufficiently Late Project Will Never Be Completed.  In general, any project which is more than 150% past its original deadline has sufficient systemic issues to permanently prevent delivery.


Sunday, February 24, 2013

Comparison of Web Service API implementation methods in ASP.NET

In ASP.NET, there are several options to implement Web Service API. Below is a quick summary:

1) XML Web Service -- SOAP
When: .NET Framework 1.0 (Feb. 2002)
What: simple service call using SOAP, XML, HTTP and WSDL.
Development tool: ASP.Net WebMethod attribute, Web Service class, auto-generated asmx description
Pros: very simple for simple service
Cons: not flexible because client has to understand SOAP. the overhead of SOAP message and XML encoding.

2) WCF -- Service Oriented Architecture (SOA)
When: .NET Framework 3.0 (Nov. 2006)
What: SOA, typically SOAP and other protocols/services/message types (XML, JSON etc).
Development tools: Visual Studio templates, classes, configurations
Pros: very flexible (duplex communication, messaging), the focus of Microsoft for general distributed SOA
Cons: heavy in size and configuration due to its flexibility

3) Web API -- RESTful API
When: was part of WCF but was combined with ASP.NET MVC 3.0  Web API (Jan 2011)
What: RESTful API over HTTP, message types are usually XML and JSON, but customizable
Development tools: many tools in both server and client side.
Pros: the current industry trend, simple and flexible.
Cons: more complex than XML Web Service because of the routing design

Which to use? The XML Web service is deprecated. The choose is between WCF and Web API. The article (http://blogs.microsoft.co.il/blogs/idof/archive/2012/03/05/wcf-or-asp-net-web-apis-my-two-cents-on-the-subject.aspx) summarized the debate as below:

  • For resource-oriented services over HTTP, use Web API
  • Others (messaging, duplex communication, TCP/UDP communication), use WCF
For Web Service development, the design of URI and API interface is a big challenge. If you application needs a set of Web API to access a data set, OData (http://www.odata.org/) standardized the APIs for this specific area.

Both WCF and Web API have very good support for OData development. It is a good start for you to develop data access API.