.NET and me Coding dreams since 1998!

31Jan/070

Download details: Visual C# 2005 Keyboard Shortcut Reference Poster

 


Download, print, use it, love it!


 


Technorati tags: , , ,

Link to Download details: Visual C# 2005 Keyboard Shortcut Reference Poster

Filed under: Uncategorized No Comments
22Jan/070

Commerce Server 2007 | Altairis – presentation

 


And in case you are interested in getting some general architectural and development spin off knowledge, join Jan Seda and me on the presentation session on Commerce Server 2007


Link to Commerce Server 2007 | Altairis - presentation


 


Filed under: Uncategorized No Comments
22Jan/070

Hiring the Best People — 10 Simple Rules

I've just come across some good advice which one should follow when hiring.

Hire Great People: 10 Simple Rules

by Barbara Reinhold
Monster Contributing Writer

Rule number one is clear, but very counterintuitive: Don't ever, ever hire somebody just like yourself. Why not? Because from the beginning of time, executives have been unconsciously cloning themselves, stocking the shelves with vanilla young men from impressive schools. And what has happened to executives and companies that did that? As management guru Rosabeth Kanter observed, they often sink into the soft sand of irrelevance as the rough waters of current reality wash over them.

Here are the other nine:

2. Hire for Attitude Rather than Skill

Teaching skills is a snap compared with doing attitude transplants. Among the qualities you'll want most is a fierce sense of optimism.

3. Look for Renegades

In interviews, ask when the person has been in trouble. The obedient employee will be of limited use to you in this change-up environment.

4. Hold out for Results

Never hire someone with good potential but questionable habits, thinking you can change him or her. As in choosing mates, what you see now is what you get forever.

5. Go for a Sense of Humor

The potential hire who can't laugh easily, particularly at herself, is going to be a very dull and probably rigid employee.

6. Fill in the Blanks

Look carefully at the aggregate strengths and skill gaps of your teams in various work units, and go for the qualities and styles that are missing.

7. Test Drive

Don't be satisfied with references. Remember that many of the most glowing references are given for people others are eager to dump. Include day-long simulations as part of your interview process, or invite applicants to provide you with a portfolio of their best work.

8. Stock the Bullpen

Keep an eye out for prospects before the need arises. Don't wait until a vacancy occurs. Keep a pool of potential employees under the watchful eye of somebody who's responsible for hiring. Evaluate your recruiting team in terms of how well they keep the bullpen ready. And tell them never to turn away an interesting candidate with the line, "We don't have any positions open right now."

9. Push Harder for Diversity

Make certain you're spreading your net wide enough to find those high-potential, but different, fish who generally don't swim in the streams near you. Ask your HR group what contacts and periodicals they're using to interest potential hires. "We don't know where to find people different from us" is a costly excuse.

10. Listen

Most interviewers talk way too much. When a candidate finally gets to you, listen for the "story line" of his or her life, at home and at work. It's been said that being a leader is like practicing psychiatry without a license. That may be more true in hiring than in any other part of the job.

The job of recruiting is too serious to be handed off in its entirety to HR. Your legacy will be set, after all, by the teams you choose to accomplish your objectives.

Source: Hiring the Best People -- 10 Simple Rules

 

 

Technorati tags: , , ,
Filed under: Uncategorized No Comments
20Jan/072

Test Driven Development session

I'm having a Test Driven Development session here in Prague for the DNG (DotNetGroup).


I'll speak about TDD in Web applications by using Model - View - Presenter dessign pattern usage in UI and mocking using Rhino mocking framework as a way of writting the tests before the code creation


The session would be handled in Microsoft, on March 1st


See ya there :)


More details on: http://akce.altairis.cz/Events/53.aspx


 


Filed under: Uncategorized 2 Comments
19Jan/072

Commerce Server 2007 Limited Resources

I'm starting to get some speed with commerce server development, but the thing which had surprised me the most is a lack of real documentation (not even one book). That's why my first post related to Commerce Server would be some start up clues where to start learning about it 

Blogs

I've create a public page flake page which aggregates all the blogs I could find on Commerce Server 2007. Check it out on My Commerce Server 2007 Page Flake. As I discover more blogs I'll add them there, so please check it out from time to time

Web Casts

Multi-Channel, Connected Commerce

Commerce Server 2007 Architectural Deep-Dive

Commerce Server Data Warehouse

Commerce Server 2007 BizTalk Adapters In Action

Developing with the Commerce Server 2007 Marketing System

Commerce Server 2007 Product Catalog Deep-dive

 

Technorati tags:
Filed under: Uncategorized 2 Comments
19Jan/075

Dependency injection and service locator

To download Dependency Injection source code example, click here


Dependency injection is a interface programing technique which is based on altering class behavior without the changing the class internals. That's been done by coding against interface inside of the class and exposing interface definition to code external to the component. There are three types (different techniques) of making dependency injection: constructor DI, setter DI and interface DI.


Service locator is a design pattern similar to dependency injection in a meaning that allows altering the class behavior without altering the class code by coding against the interface inside of the class. The difference is that there's no direct exposure of interface to code outside of the class. Instead class is using "well known object" inside, to get from it desired interface implementation.


This helper well known object can be 3pt framework such as Structure Map or to build the framework by ourselves


Use case


The example I'll be using here is a kind of paycheck application which should write appropriate worker checks with appropriate amounts and title. Currently, there are two types of workers: Developer and Program manager, but in the future there could be some more. Developer has salary of $100 and the program manager has 3x bigger salary (like in real world, isn't it? :) )


The task is to make a paycheck application which would without the changing of the app code allow printing the paychecks for the different type of workers


Common implementation


There would be an IWorker interface defined like:


    public interface IWorker
    {
        string Name { get; set;}
        string SurName { get; set;}
        string Occupation { get;}
        decimal Salary { get;}
    }


And that interface would be implemented by Developer and ProjectManager classes


Developer class


public class Developer : IWorker
{
        public Developer(string name, string surname)
        {
            _name = name;
            _surname = surname;
        }

        #region IWorker Members

        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _surname;
        public string SurName
        {
            get { return _surname; }
            set { _surname = value; }
        }

        public string Occupation
        {
            get { return "Developer"; }
        }

        public decimal Salary
        {
            get { return HelperMethods.GetSalary(TypeOfWorker.Developer); }
        }


}


Worker class


public class ProjectManager:IWorker
    {
        public ProjectManager(string name, string surname)
        {
            _name = name;
            _surname = surname;
        }

        #region IWorker Members

        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _surname;
        public string SurName
        {
            get { return _surname; }
            set { _surname = value; }
        }

        public string Occupation
        {
            get { return "Project manager"; }
        }

        public decimal Salary
        {
            get { return HelperMethods.GetSalary(TypeOfWorker.ProjectManager); }
        }

        #endregion
    }


Both of classes, Developer and Manager for calculation of the Salary would use a helper method class GetSalaryMethod


public class HelperMethods
{
        public static decimal GetSalary(TypeOfWorker typeOfWorker)
        {
            decimal baseSalary = 100;
            if (typeOfWorker==TypeOfWorker.ProjectManager)
            {
                baseSalary = baseSalary*3;
// :)
            }
            return baseSalary;
        }
}


Our little class which would print the paychecks would be called PayCheck and it would have a void method PrintTheSalary()


Dependency injection - Constructor type


Constructor type dependency injection is based on a approach where the interface parameter which is referenced internally inside the class is been exposed through the constructor. In our example, class PayCheck would have a constructor which would have an IWorker parameter.


Implementation :

public class PayCheckCtor
{
      private IWorker _worker;

       public PayCheckCtor(IWorker worker)
        {
            _worker = worker;
        }

        public void PrintTheSalary()
        {
            Console.WriteLine(
                string.Format("Name:{0}, Surname: {1}, Title: {2}, Salary:{3}", _worker.Name,
               _worker.SurName, _worker.Occupation, _worker.Salary));
        }
}

Usage:


Developer developer = new Developer("Nikola", "Malovic");
ProjectManager manager = new ProjectManager("John", "Doe");

PayCheckCtor payCheck;
           
payCheck = new PayCheckCtor(developer);
payCheck.PrintTheSalary();

payCheck = new PayCheckCtor(manager);
payCheck.PrintTheSalary();


The good side of this approach is that in the moment when the code inside of the PayCheck class accessing the interface property, that property is guarantee to be initialized. The down side is that once injected value of the Interface can not be altered during the life time of the implementation (PayCheck)class  after the instance is been constructed.


Dependency injection - Setter type


Setter type of the DI pattern is enabling the injection of the interface implementation through the public property with set block. It is basically approach trying to cover the downsides of constructor based approach,


Implementation


public class PayCheckSet
{
        private IWorker _worker;
        public IWorker worker
        {
            set { _worker = value; }
        }

        public void PrintTheSalary()
        {
            Console.WriteLine(
                string.Format("Name:{0}, Surname: {1}, Title: {2}, Salary:{3}", _worker.Name,
                _worker.SurName, _worker.Occupation, _worker.Salary));
        }
}


Usage


Developer developer = new Developer("Nikola", "Malovic");
ProjectManager manager = new ProjectManager("John", "Doe");
PayCheckSet payCheck = new PayCheckSet();

payCheck.worker = developer;
payCheck.PrintTheSalary();
           
payCheck.worker = manager;
payCheck.PrintTheSalary();


The good side in this approach is that  it allows flexible changing of the interface implementation (on the fly). The down side is that when the code inside the class uses interface field, it is not guaranteed that the field wouldn't be null


Dependency injection - Interface type


Is a dependency injection technique which is a kind of explicit defined setter type DI. The object which would use the interface property has to support interface which defines the method which sets the interface property


Implementation


There would be an interface which defines setting of the interface property value


public interface ISetWorker
{
            void SetWorker(IWorker worker);
}


Implementation class (PayCheck) would have then to implement that interface


public class PayCheckIntf : ISetWorker
{
        private IWorker _worker;

        public void SetWorker(IWorker worker)
        {
            _worker = worker;
        }
       
        public void PrintTheSalary()
        {
            Console.WriteLine(
                string.Format("Name:{0}, Surname: {1}, Title: {2}, Salary:{3}", _worker.Name,
               _worker.SurName, _worker.Occupation, _worker.Salary));
        }
}


Usage


Developer developer = new Developer("Nikola", "Malovic");
ProjectManager manager = new ProjectManager("John", "Doe");

PayCheckIntf
payCheck = new PayCheckIntf();

payCheck.SetWorker(developer);
payCheck.PrintTheSalary();

payCheck.SetWorker(manager);
payCheck.PrintTheSalary();


Service locator


For all three explained dependency injection techniques the common is the fact that they are ignorant completely about where from implementation of the interface comes and when it would be initialized.


Service locator is also a dependency injection technique, but the decision about the way and moment of the implementation is moved to the implementation class itself (instead of outside interface implementation definition)


It could be even said that it is more  Dependency Absorption rather Dependency Injection :)


Implementation


Service locator is usually either 3pt framework or our special assembly, which can decide about the type of interface implementation based on some configuration settings or something similar. Basically the whole point in using service locator is to extract and abstract the interface implementation decision outside of the implementation class. It is not a good practice that the implementation class is calling the Service Locator method by providing some method (like a Factory does) because implementation class should be ignorant about the Service Locator implementation.


In this example, Service locator implementation uses Singleton with GetWorker and RegisterWorker methods


I didn't want to implement it fully with configuration settings of desired implementation, because it would introduce unnecessary complexity to sample.


public class WorkersServiceLocator
    {
        private static IWorker _worker;


        public static IWorker GetWorker()
        {
            return _worker;
        }

        public static void RegisterWorker(IWorker worker)
        {
            _worker = worker;
        }
    }


The PayCheck implementation using that ServiceLocator


public class PayCheckServLocator
    {
        public void PrintTheSalary()
        {
            ServiceLocator.IWorker _worker
                =ServiceLocator.WorkersServiceLocator.GetWorker();
            Console.WriteLine(
                string.Format("Name:{0}, Surname: {1}, Title: {2}, Salary:{3}", _worker.Name,
                _worker.SurName,  _worker.Occupation, _worker.Salary));
        }
    }


Usage


Developer developer = new Developer("Nikola", "Malovic");
ProjectManager manager = new ProjectManager("John", "Doe");

PayCheckServLocator payCheck = new PayCheckServLocator();

WorkersServiceLocator.RegisterWorker(developer);
payCheck.PrintTheSalary();

WorkersServiceLocator.RegisterWorker(manager);
payCheck.PrintTheSalary();


The good side in this approach is that  the control is allowed to control the moment of interface variable definition. It still allows flexible changing of the interface implementation because the service location internals are abstracted from  the implementing class level. The down side is that the implementation class is not so dumb any more and it has to take care about things outside of her scope (call to ServiceLocator method)


Conclusion:


Dependency injection is a very powerful technique very much used in Test Driven Development and I would speak more in near future about it in posts about TDD


 


Filed under: Uncategorized 5 Comments
19Jan/070

Vacation is over…

 


I've been very busy during the last couple weeks so I had only time for short posts about the cool and new thins I've seen, but I'm back in town now


In the mean time a lot of the new fascinating things emerged on P&P sky: Web Service Factory Dec Release, Web Application Factory, ENTLIB 3.0 etc


That's why I would speed up posting about design patterns used by P&P team, explaining them on a simple way as a kind of introduction to the P&P Factory Specific series of posts


I've blogged already about MVP design pattern


Today I've blogged about Dependency Injection and Service Locator patterns


Next post would be about Command and Adapter pattern usage where I would use IE7 Style navigation control


I'll post then about the event broker pattern and the last post would be about asynchronous call web services with time out pattern


After that introductory posts I'll continue the serie with some Smart Client Software Factory posts


Stay tuned :)


 


Technorati tags: , , ,

Filed under: Uncategorized No Comments
18Jan/070

Microsoft Live Labs: Photosynth

On the the blog of the Srinath Vasireddy I've found the link to the Microsoft Live Labs PhotoSynth application (ehm.. maybe technology is more appropriate then the application)

Amazing real time data processing and potential for totally new types of applications

Check the videos section for introduction to the application  

Awesome!

Link to Microsoft Live Labs: Photosynth

PS:"The first project of Photosynth-ing is the digitalization of the Old Town Square in Prague :)"

Filed under: Uncategorized No Comments
15Jan/070

Upcoming AJAX Security Webcasts

Link to Upcoming AJAX Security Webcasts


For all you folks worried about the possible security issues with Ajax based web sites, there would be a series of the Webcasts which are "Have To" for all the developers who are planing to do ajax web sites


Here are the direct links to register for all five webcasts in the series (starting on January 18th)


Live From Redmond: AJAX Security Basics- The Building Blocks to Protecting Your Applications Built with ASP.NET AJAX

Live From Redmond: How Hackers Reverse Engineer and Exploit an ASP.NET AJAX Application

Live From Redmond: The Brave New World of AJAX Hacking (and prevention using ASP.NET)


Live From Redmond: The Next Generation of AJAX Attacks – A New Generation of Attack Theories


Live From Redmond: Best Practices: A Look at Developer ASP.NET AJAX Security Mistakes

 


 


Filed under: Uncategorized No Comments
11Jan/070

Jim Galasyn’s Learning Curve : Orcas January CTP is posted

 


New release of Orcas available... Still hot :)


Link to Jim Galasyn's Learning Curve : Orcas January CTP is posted


Filed under: Uncategorized No Comments