Alik Levin's

Clarity, Technology, and Solving Problems | PracticeThis.com 

October, 2008

  • Alik Levin's

    ASP.NET Performance: Fast AJAX, Faster AJAX

    • 1 Comments
     Alik Levin    AJAX improves significantly both user experience and performance. It can be further improved by using down level capabilities that .Net framework offers. Specifically, consuming Web Services and WCF directly from client script. The best part is that ASP.NET AJAX comes with built in libraries - server and client - that make coding fun while significantly improving the web application's performance.

    Customer Case Study

    The customer was using hand crafted XmlHttp requests from client scripts requesting the data from ASPX pages. While the goal was achieved - the amount of information sent to the server was minimal and the user interface was responsive - the coding was not really fun. Also, since the requests were sent to regular ASPX pages the whole ASPX pipeline was executing unnecessarily utilizing CPU for nothing. The customer did not want to use Update Panel control. Although it boosts coding productivity, it also adds some burden on the network. Network utilization should have been kept to the minimum.

    Analysis

    After quick research I found two great resources that directed me to the solution that would satisfy both requirements:

    1. Coding productivity.
    2. Minimum of data in transit on the wire.

    The first one is from Chris Hay  - remix08 UK ASP.NET Front End Performance Slides and the other one is from Jeff Prosise - Power ASP.NET AJAX Programming. They both outline the usage of Script-Callable Web Services. There are three simple steps to follow:

    • Declare your Web Service as Script-Callable by adding class level attribute:
    [System.Web.Script.Services.ScriptService]
    public class AJAXCallableWebService : System.Web.Services.WebService
    {
        [WebMethod]
        public string HelloWorld(string name)
        {
            return "Hello, " + name;
        }
    }
    • Declare service reference inside the ScriptManager:
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference InlineScript="true" Path="~/AJAXCallableWebService.asmx" />
        </Services>
    </asp:ScriptManager>
    • Call a Web Service from the client script:
    <script type="text/javascript" language="javascript">
    function callAjax()
    {
        var text = document.getElementById("Text1").value
        
        AJAXCallsWebService.AJAXCallableWebService.HelloWorld(text,onSuccess);
    }
    function onSuccess(result)
    {
        document.getElementById("result").innerText = result;
    }
    </script>
        <span id="result"></span>
        <input id="Button1" type="button" value="button" onclick="callAjax()" />
        <input id="Text1" type="text" />
    

    Sample Visual Studio Solution

    Grab the sample solution implemented using Visual Studio 2008 form my SkyDrive here:

    Related Materials

    submit to reddit

    This template is made with PracticeThis.com plugin for Windows Live Writer

  • Alik Levin's

    Consultant Eaten By Sharks

    • 2 Comments
     Alik Levin    "If you swim with sharks, do not act like food" - I can crystal clearly remember that quote by Michio Kaku when he was giving a keynote during internal MS convention. It resonated with me a lot. As a consultant, I often find myself deep in the waters surrounded by sharks. Sometimes frightened to death. To "survive" I develop practices that distinguish me from "food" to keep me from being eaten.

    I found many practical advices when I was  reading a book by Harvey Mackay Swim with the Sharks Without Being Eaten Alive: Outsell, Outmanage, Outmotivate, and Outnegotiate Your Competition.

    This post is a collection of a few side notes that I took while reading the book. These advices, among few others,  help me stay alive and not eaten by sharks.

    Do You Believe In Luck?

    I do. For me luck is being the right guy in the right place at the right time. Sitting at home, doing nothing all the time won't get you no luck. Here is nice quote Harvey Mackay used in his book:

    "I am great believer in luck,"  said Stephen Leackock, the Canadian humorist, "and the harder I work, the luckier I get".

    Another one that I really love is from Thomas Alva Edison:

    "Opportunity is missed by most people because it is dressed in overalls and looks like work."

    Doing vs. Achieving

    This one keeps striking me time after time. Many of us still have hard times to distinguish between doing vs. achieving. Working vs. accomplishing. End result is what really matters. Here is what Harvey Mackay has to say about it:

    "One thing professional stock and commodity traders learn early is that they don't give away medals for courage in the marketplace. There is only one reward the marketplace has to offer: money. If you are not making any, bail out. Quickly."

    Well, you cannot argue with it these days...

    Hire The Best

    I was reading the book by 45 EFFECTIVE WAYS FOR HIRING SMART: How to Predict Winners and Losers in the Incredibly Expensive People-Reading Game by Pierre Mornell where he provides a very detailed process to hire the best talent. The whole book is dedicated to interviewing... After your complete all the procedures (many of which are very useful), how do you decided - "Hire" or "No Hire"? Harvey Mackay offers very simple yet powerful advice:

    "Ask yourself, How would you feel having this same person working for your competition instead of for you?"

    Competitive World

    Harvey Mackay writes:

    "Unless you have a unique product or service, or run state-owned bakery in the Soviet Union, competition is a fact of life. You must deal with it. The best way is to gather what knowledge you can and then act."

    My observations of state-owned bakeries only prove what Harvey Mackay writes (I was born in former USSR and lived there until I turned 20). My other observations resonate a lot with what he writes about gathering knowledge and acting. Focusing on high demand expertise pays off. The deeper your knowledge the harder it to push you down the food chain.

    "The grabbing hands grab all they can
    All for themselves - after all
    It's a competitive world
    Everything counts in large amounts" - Depeche Mode

    My Related Posts

    This template is made with PracticeThis.com plugin for Windows Live Writer

  • Alik Levin's

    Seven Habits Of Highly Effective Consultants

    • 1 Comments
     Alik Levin    I was reading The Practice of Leadership blog that briefly reviewed Steven Covey's book The 7 Habits of Highly Effective People. I like Steven Covey's approach. In fact, I massively use Steven's Urgent/Important quadrants to prioritize my daily work (as outlined here - Prioritize What You Do – Steven Covey Way [The Way That Works]).

    I thought it'd be interesting to test myself as a consultant for effectiveness according to Steven Covey.

    Seven Habits

    1. Be proactive.
    2. Begin with the end in mind.
    3. Put first things first.
    4. Think win-win.
    5. Seek first to understand, then to be understood.
    6. Synergize.
    7. Sharpen the saw.

    All these habits should serve some sort of goal or objectives. Being proactive or thinking win-win won't make a trick without having clear goals. What are you goals? What are your objectives? Here are mine:

    • Make my family happy by maintaining healthy Work/Life Balance (WLB).
    • Make my managers happy by accomplishing what I am supposed to and a bit beyond.
    • Make my customers happy by solving their problems effectively, offering them first class professional service.
    • Make myself happy by doing interesting work with proper impact.

    If your goals are similar to mine then the following practices might help you hitting them.

    Habit 1 - Be proactive

    Proactively manage your time. Consultant live and breathe time. Utilization (or billable time) is consultant's main product. Spending time for non-billable time activities will hurt your WLB. Proactively allocate time for billable (actual consulting), non-billable (training, biz dev), and personal activities. Here is how I manage my time annually, monthly, weekly, and daily:

    Habit 2 - Begin with the end in mind

    What do you want to accomplish? What's your definition for success? Imagining the end results can help achieving it. See it through, deliver it, exceed it. Become a super hero.

    Habit 3 - Put first things first

    You have more to do than there are hours. How do you prioritize what's important and what is not? I found Steven Covey's technique is very practical:

    Habit 4 - Think win/win

    Establish right communication channels with your manager, customers, and the family. Speak their language. Do not get mad when failed. Practice emotional intelligent. Win the Heart, the Mind Follows.

    Habit 5 - Seek first to understand, then to be understood

    When the communication channels established you are ready to understand the other party. You are ready to understand what matters the most to your manager, to your customers, to your family. When understood you can better help the other party understand yourself. When your manager pushes you to another gig you understand that it is because of the deficit in the team's budget. You could close another deal for better price while dealing with better technology. Win/win. When your customer is calling your every hour it is because she wants to be in control of project progress. You could send progress reports proactively and save the head aches. Win/win. Fulfill their dreams and they will do the same to you.

    Habit 6 - Sinergize

    Consultant is a field warrior. A Peaceful Warrior. A loner. Nevertheless, he is part of a larger team. The team of sales, marketing, support, operations, and other specialists. Build trust within the team and the team will support you when you are all alone in the field.

    Habit 7 - Sharpen the saw

    This one is fundamental in order to survive. Better consultant is the one with deeper skills. Become a SME (subject matter expert), but do not pigeon hole your self into too narrow area of expertise. It might become obsolete tomorrow. Stay tuned with what happens in industry and adjust accordingly. I adopted Abraham Lincoln's:

    "Give me six hours to chop down a tree and I will spend the first four sharpening the axe"

    Question

    What are your practices that make you better consultant?

     

    This template is made with PracticeThis.com plugin for Windows Live Writer

Page 1 of 2 (6 items) 12