Inside/Outside

You look at a thing and you want to describe and understand it. There are many ways, but we can broadly define two principal ways.

Outside View Point (OVP):
Everything has external view to its environment. When a thing is described with less focus on its internals, that is OVP.

Inside View Point (IVP):
Everything is internally composed of other things. When a thing is described with more focus on its internals and less focus on its externals, that is IVP.

Also, internals of a thing are things too. So, internal things have their own IVP and OVP.
Here are some examples. Note that decision, if a statement is IVP or OVP, is subjective.
Following are my views on few statements as a layman car user, based on my intellect and knowledge.

A car has a red color: OVP
A car has an MPFI engine and is 4WD vehicle: IVP
A car has engine made with special aluminum alloy: IVP
A car is saleable thing: OVP
A car needs maintenance every 10000 kms: OVP
A car turns left when you turn steering wheel counter clockwise: OVP
A car needs proper suspension: IVP
A car must not jump too much during ride on normal road: OVP
A car has factory-installed locking differentials use a computer-controlled multi-plate clutch or viscous coupling unit to join the shafts: IVP

It is very important that IVP and OVP are understood enough to clearly describe a thing. How much details are enough for IVP or OVP is usually context sensitive. These two views are important because you can always use them fruitfully in some way. They are more important because our brains are programmed to use them.

Usually, we tend to use either IVP or OVP. Once we are biased about one, we become blind toward the other. Each thing is a unity in itself even if externally only few characteristics are manifested and internally it is made of multiple things. Being blind towards either IVP or OVP renders description of a thing incomplete.

Most of the times, thing to be described, is not trivial. So it is very normal to further partition within both IVP and OVP. It is normal to create team, with each person focusing on subset of such partitions. For big thing, there may be need for team of team of teams. Note that each partition has its own IVP and OVP.

IVP focuses more onto these: analysis, structure, architecture, design, utility, technicality, how & why
IVP usually have more amounts of details. To grasp IVP, you need good left brain.
OVP focuses more onto these: intuition, judgment, aesthetics, surface view, what & where
OVP usually have comparatively less amount of details. To grasp OVP, you need good right brain.

In nutshell, you need to know enough of IVP and OVP of a thing to ‘know’ it. That will be more complete knowledge!

PS: All these apply to software and its artifacts very well!
  • RSS
  • Print
  • PDF
  • Twitter
  • del.icio.us
  • Facebook
  • LinkedIn
  • Google Bookmarks
  • Digg
  • Add to favorites
  • StumbleUpon

Interesting predictions for out sourcing

It is highly likely that India will be challanged even more for cost efficiency and higher valued services. Here are some observations and predictions from Gartner, Bernstein Research and Forrester Research; with my interpretation for implications.

Evolving From Evolving To Implications
Offshore labor primarily in India Labor in multiple geographies India will have competition; also as market size increases, India will have opportunity to rise in value chain
Off shoring provides cheap labor Off shoring provides efficient access to large talent pool and great technologies All offshore work will have to be higher in value
Many tactical out-sourcing vendors Few strategic out-sourcing vendors Customers will weave out-sourcing as part of business strategy instead of just focusing on cost efficiency
More focus on maintenance More focus on design, test and maintenance Out sourcing vendors will have to do both creative and labor oriented work
More focus on code More focus on consulting, SOA, infrastructure and code Simply put, out sourcing vendor will be key to success of customers’ IT success both in cost and value terms
Out sourcing is special Out sourcing is standard Out sourcing business will still keep growing
  • RSS
  • Print
  • PDF
  • Twitter
  • del.icio.us
  • Facebook
  • LinkedIn
  • Google Bookmarks
  • Digg
  • Add to favorites
  • StumbleUpon

Design is a contexual process

(Though following is written from point of view of software designer, ideas are valueable to any engineering designer.)

Software design is creative process. Design involves significant mental efforts towards creating new ideas or using existing ones for a purpose. Software does not exist before you design it. You, as a designer, play a role of The God. You make decisions about structure and behaviour of software-to-be-constructed.

Design is more of an invention and less of a discovery. As a creator, you may take guidance from other experienced creators or knowledge-base, but you must never forget that your design is primarily your creation and it is up to you to make final decisions about it during specific project, and be accountable for it as a designer.

And design is done, by definition, before construction. Note that design may be for a system, for a subsystem, for a component, for a class, for a method or for any other element. Sometimes you first construct software, then learn from software construction and then design a better one. Still, this better design will be meaningful only if it is implemented. In the most basic sense, designs are created for implementations. That is where painters are luckier than building architect. Both draw pictures of some sort. But architect’s drawing is called design as it is intended to be implemented. This essential property of design that, it is intended to be implemented, is called feasibility of design. Every design must be feasible to sufficient degree.

Any design can be subjectively judged for quality from judgement of how easily design can be implemented in a context. Obviously, judge’s skill and knowledge about both construction and design comes into picture. This make design evaluation two-folds.

1. Design must be fit for purpose sufficiently in a context or in other words, design must be sufficiently easy (ignore inherent complexities) to use for constuction for a context.
2. Design’s quality attributes may easily become subjective in practical situation of a specific project.

Overall, design is very context-sensitive activity. If you do not understand context of design, then you may end up taking inappropriate design decisions. Let us try to see what kind of contextual information you need to do good design.

Purpose: If you are not purposeful, either you will come up with design which will not serve its purpose or design will not allow constructors to produce software with proper quality attributes. Without purpose, you will not have any yardstick to measure success of design. This usually means your clarity about software developement lifecycle objectives.

Business: Beyond knowing verticals, you should be clear about your customer’s business and his expectations in context of a specific project.

Design Tools and Processes: Beyond knowing modelling platform e.g. UML & tools in combination with methodologies e.g. OOAD, you need to know contextual application to specific project after tweaking generic ideas.

Construction Platform: If you do not have good contextual information about construction platform, you may end up doing less feasible design.

Organization Platform: You will work for yourself or somebody else. Make sure you know ways of working within your organization or your project team or your immediate-colleagues team in such a way that your personal context is aligned with organizational context.

Any other project specific contextual information: This one is toughest, and this is what makes each project unique. This is where your creativity, communication and analytical abilities are tested. No matter what, each project has this and you have to unconver this context.

Summary in nutshell: Design is a contexual process.

You can utilize guidance from articles, knowledgebase, best practices, patterns, frameworks, consltants etc but finally, you have to apply all guidance according to your understanding of your context as a designer. You do not have to apply all generic things as they are. In a hindsight, you must have kept your brain on while you have applied generic ideas to your specific project!

  • RSS
  • Print
  • PDF
  • Twitter
  • del.icio.us
  • Facebook
  • LinkedIn
  • Google Bookmarks
  • Digg
  • Add to favorites
  • StumbleUpon

New features of C# 3.0

Look at simple source code to learn few of new features of C# 3.0.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public class Book
{
    //Auto implemented properties
    public string Name { get; set; }
    public int ID { get; set; }
}
public class AllLINQ
{
    public static void ShowAll()
    {
        //Collection Initializer and Implicitly Typed Local Variables using 'var'.
        //Note how List<Book> is created and filled in one line of source code.
        var Books = new List<Book> { new Book { Name = "Learn C#", ID = 1 },
            new Book { Name = "Learn .Net", ID = 2 },
            new Book { Name = "Power Electronics", ID = 3 } };
        //LINQ
        var BooksQuery = from book in Books
                        //calling extesion method
                        where book.IsLearningSeries()
                        //Anonymous Type
                        select new { FetchedBook=book, TimeStamp=System.DateTime.Now };
        foreach (var SearchedResult in BooksQuery)
        {
            Console.WriteLine(" Searched at : " + SearchedResult.TimeStamp);
            Console.WriteLine(" Book Name : " + SearchedResult.FetchedBook.Name + ",
                                        Book ID = "
+ SearchedResult.FetchedBook.ID);
        }
    }
}
public static class Extensions
{
    //Extension Method for Book class. Note 'this' against parameter.
    public static bool IsLearningSeries(this Book b)
    {
        return b.Name.Contains("Learn");
    }
}
  • RSS
  • Print
  • PDF
  • Twitter
  • del.icio.us
  • Facebook
  • LinkedIn
  • Google Bookmarks
  • Digg
  • Add to favorites
  • StumbleUpon

C# and .Net Delegates

Please read following simple source to know more about delegates in C# and .Net. Note that this article is for people who wants to learn by looking at simple sample source code without reading too much weed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
namespace Delegates
{
    class Program
    {
        //Following is delegate capable to refer to method taking two int para and returning int.
        delegate int SimpleDelegate(int i, int j);//SimpleDelegate is a type
        int Subtract(int i, int j) { return i - j; }
        static int Sum(int a, int b) { return a + b; }
        static void Main()
        {
            int res;
            SimpleDelegate dlgt;
            Program p = new Program();

            dlgt = Sum;//Assign static method reference.
            res = dlgt(20, 10);//Invoke delegate. Equivalent to Sum(20, 10)
            Console.WriteLine("n1. Result : " + res);

            dlgt = p.Subtract;//Assign non-static method reference. Need object.
            res = dlgt(20, 10);//Invoke delegate. Equivalent to p.Subtract(20, 10)
            Console.WriteLine("n2. Result : " + res);

            dlgt = delegate(int i, int j) { return i * j; };//assign anonymous method
            res = dlgt(20, 10);//Invoke delegate
            Console.WriteLine("n3. Result : " + res);

            //lambda exression: X => Y
            //X is list of input, Y can be expression.
            dlgt = (i, j) => i / j;//assign using lambda expression
            res = dlgt(20, 10);//Invoke delegate
            Console.WriteLine("n4. Result : " + res);

            //Action<> is generic delegate taking N type-para.
            //Action can only refer to method taking N para of specified types and returning void.
            Action<int, int> print = (i, j) => Console.WriteLine("n5. Remainder : " + i % j);
            print(20, 10);

            //Predicate<> is generic delegate taking 1 type-para.
            //Predicate can only refer to method taking 1 parameter of specified type and returning bool.
            Predicate<int> IsFive = i => i == 5;
            Console.WriteLine("n6. Result : " + IsFive(20));

            //Func<> is generic delegate taking N type-para.
            //Func can only refer to method taking N-1 para of specified type and returning value of Nth type.
            Func<int, int> f1 = i => i + 1;
            Console.WriteLine("n7. Result : " + f1(20));

            //Comparison<> is generic delegate taking 1 type-para.
            //Comparison can only refer to method taking 2 para of same type and returning int.
            //Method must return -ve, 0 or +ve as a result of comparison
            Comparison<int> comp = (i, j) => i < j ? -1 : (i > j ? 1 : 0);
            Console.WriteLine("n8. Result : " + comp(20, 10));

            //Converter<> is generic delegate taking 2 type-para.
            //Converter can only refer to method taking 1 para of first type
            //  and returning converted result of second type.
            //Following converts string to bool.
            Converter<string, bool> convert = s => Convert.ToBoolean(s);
            Console.WriteLine("n9. Result : " + (convert("true") == true ? "Conversion done" : "???"));

            Console.ReadLine();
        }
    }
}
  • RSS
  • Print
  • PDF
  • Twitter
  • del.icio.us
  • Facebook
  • LinkedIn
  • Google Bookmarks
  • Digg
  • Add to favorites
  • StumbleUpon