CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Ranjan Sakalley

June 2005 - Posts

  • Can TDD help managing and guiding off-shore teams?

    One of the first ideas that I had, when I started reading about TDD was this -

          Can a manager/lead keep track of the code written by his team, by inspecting and adding to the tests written by them?

    My experiments give me an affirmative. What about you?

    Also, I wonder if an off-shore team can be managed following this process, atleast in terms of development direction?



    Posted Jun 21 2005, 11:50 PM by rsakalley with 4 comment(s)
    Filed under:
  • On quality consciousness of Off-shore development organizations

    Sahil here mentioned the state of H1B holders in the US. Profounding statements, and nicely put. Must read. There is a reference that comes though in one of the praragraphs, about the state of mind, and the their life style in the US. There is no mention on the work-quality, which has come under much criticism, so I would like to add to, on that front.

    One of my observations, during a little bit of hiring here in India has been that Indian Software workers are above average earners in this country, and cities like Bangalore have a huge clout of these big-earners, and everybody's getting attracted to such places. Earlier, people used to get Rs 5000 (around $125) per month, and are now getting Rs 40k ($ 1000). The industry's like a honey pot and all including me are attracted.

    Everybody's looking for such jobs . People who don't have a good programming background, not even the talent to be analysts or developers are interested into becoming programmers (its another argument that you dont need talent to write code, but thats okay, I subscribe to that, but its private).

    That's just one face of the coin. There is a good number of Indian Services Providers, who charge very less, compared to their US of A counterparts, but in terms of dollar conversion to Rupees, they are still earning 10 times over the employees' salaries. And they want more. For a job that can be done by a 100 guys, they hire 400 (that's called the SEI CMM syndrome by us locals). And they hire and charge for these guys (which is called the Headcount formula), because they want to increase their revenues. To improve from 100 to 400, you need cheaply available guys, which are just around the corner.

    So that's one of the reasons. Cheap training and poor management (which are just the guys I talked about, promoted) are other reasons.

    But yes, there is more to it. Criticism apart. There are good companies, with really good staff, and visionaries on their board, who not only are looking at quality (which is much more that CMM levels, that they have, but they look for much more than that) but class people, who will make the organization proud when they move over to any off-shore location. These organizations hire smart people, attract smarter people, pay nice enough salaries, make their off-shore stays at the least as comfortable as home, and are honest, hire only the needed, morover they prove their mettle with their product. My vote goes to such organizations. I prefer not to name any one of such an organization, as I do not name any of the ones I criticized. I also would like you to comment on your organization, tell more about the kind of work-culture they have, share your experience. Personally I prefer to work for such organizations, and one day would like to build one such company.



     
  • How to resize the columns of the grid databound to an array at runtime?

    While working on the new product (and that's why the break) we got into a DataBinding situation. We had a DTO class, something like this

    public class Employee
           {
                  private string employeeName;
                  private string employeeId;

                  public string EmployeeName
                  {
                         get { return employeeName; }
                         set { employeeName = value; }
                  }

                  public string EmployeeId
                  {
                         get { return employeeId; }
                         set { employeeId = value; }
                  }

                  public Employee(string employeeName, string employeeId)
                  {
                         this.employeeName = employeeName;
                         this.employeeId = employeeId;
                  }
           }

    and to show the data on a DataGrid (System.Windows.Forms.DataGrid) we used an array of such an object as a DataSource to the grid. And then we got into a situation. How to resize the columns of the grid at runtime? Using TableStyles ? Would the following code work (this is the method written in the wrapper to the DataGrid and called on DataSourceChanged event)?

                  private void RedrawGrid()
                  {
                         if (this.DataSource == null || this.Width == 0)
                         {
                               return;
                         }

                         this.TableStyles.Clear();
                         Array dataSource = (this.DataSource as Array);
                         Type type = dataSource.GetValue(0).GetType();
                         //tableStyle.MappingName = type name or variable name?
                         DataGridTableStyle tableStyle = new DataGridTableStyle();
                         tableStyle.AlternatingBackColor = Color.GreenYellow;

                         foreach (PropertyInfo property in type.GetProperties())
                         {
                               DataGridTextBoxColumn columnStyle = new DataGridTextBoxColumn();
                               columnStyle.MappingName = property.Name;
                               columnStyle.Width = this.Width/this.VisibleColumnCount;
                               tableStyle.GridColumnStyles.Add(columnStyle);
                         }
                         this.TableStyles.Add(tableStyle);
                  }


    This is how you would do the stuff if the DataSource was a DataTable. Right? No, I missed the MappingName. Without this, the style won't be mapped to the Grid. So what do you normally set the MappingName to when you bind the grid to a DataSet/Table? answer: The TableName. Something like this

    //strictly if the source is a table, and here just for reference
    tableStyle.MappingName = (this.DataSource as DataTable).TableName;



    But what would you set it to, when it comes to an array? Does the same idea, that of the variable's name work here? Surprisingly NO

                        // Works
                         Array dataSource = (this.DataSource as Array);
                         Type type = dataSource.GetValue(0).GetType();
                         tableStyle.MappingName = type.Name + "[]"; //i.e. Employee[]
                         dataGrid.TableStyles.Add(tableStyle);


    In the case of a DataTable, the TableStyle is mapped to the TableName (that is, the name of a variable), while in this case, its named to the class's name (string "Employee[]"). not the base class's name (System.Array), not the fully qualified name ( Proteans.DataTransfer.Employee[], but just Employee[]. And yes, no guidelines from MSDN whatsoever?

    Anyway, it worked and I am happy. So for people who were searching for a way to have the runtime column resizing feature for a Datagrid bound to an Array, use the Array type as the mapping name, and define the ColumnStyles etc. then on. My 2 cents.




     






    Posted Jun 07 2005, 11:29 PM by rsakalley with 5 comment(s)
    Filed under:
More Posts

Our Sponsors