Feeds:
Posts
Comments

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads Wow.

Crunchy numbers

Featured image

The average container ship can carry about 4,500 containers. This blog was viewed about 18,000 times in 2010. If each view were a shipping container, your blog would have filled about 4 fully loaded ships.

 

In 2010, there were 36 new posts, not bad for the first year! There were 78 pictures uploaded, taking up a total of 9mb. That’s about 2 pictures per week.

The busiest day of the year was October 12th with 1 views. The most popular post that day was Deep Inside Structural Patterns :: Decorator Pattern :: Part 2.

Where did they come from?

The top referring sites in 2010 were reddit.com, arabteam2000-forum.com, dzone.com, Google Reader, and friendfeed.com.

Some visitors came searching, mostly for .net framework poster, tortoisesvn visual studio 2008, tfs 2010 client, .net framework 4.0 poster, and .net framework.

Attractions in 2010

These are the posts and pages that got the most views in 2010.

1

Deep Inside Structural Patterns :: Decorator Pattern :: Part 2 May 2010
3 comments

2

Deep Inside Structural Patterns :: Decorator Pattern :: Part 1 April 2010
13 comments

3

.NET Framework Posters March 2010
4 comments

4

VS 2010 First Look :: Multi-Screen Support April 2010
1 comment

5

VS 2010 First Look :: “Navigate To” Dialog Box May 2010
2 comments

Thank you WordPress 🙂

Advertisements

[tweetmeme  source=”aabdulmoniem” only_single=false]

I have just finished “Beginning Silverlight 4 in C#” book written by Robert Lair from Apress and I would like to share my humble opinion about it.

Really and simply, it is a great book to grasp many concepts about Silverlight 4 in a just 400 papers. For me, I have finished the book in four days (3-5 hours / day) and of course there are some reasons for that, a couple of them are:

  1. I am not so beginner in this technology as I have used WPF before so I didn’t need any time to grasp multiple concepts quickly.
  2. I need to finish this book as quickly as possible to wrap most of the features and abilities of the new version of Silverlight. In fact my team is going to develop a business application using Silverlight and I was in real need to see the full picture of this technology.

Enough talking about myself, let’s talk about the book.

This book talks about:

  • Why we need Silverlight and how it fits in the RIAs? Really a good and brief introduction gives the reader why he is gonna read about such a new technology.
  • VS 2010 new features and how it supports Silverlight 4 and what you need to get started. BTW, there are some posts here in my blog about the new features of VS 2010 you can find it in “Cutting Edge” column.
  • Layout management in Silverlight. It mentioned some of layout controls and how you can use it to layout your applications like the Grid, WrapPanel, DockPanel, Canvas, and StackPanel.
  • Some of Silverlight controls and some basic examples about them like TextBox, Button, TextBlock … etc.
  • List controls like DataGrid and ListBox besides data binding mechanisms which is so so powerful in the world of XAML.
  • Silverlight toolkit, and what it contains.
  • How you can get access to data in Silverlight (WCF is recommended approach), how you can use Sockets for data access and network communications.
  • Navigation framework which is so similar to master pages and content place holders in ASP.NET. Also, how you can pass data between different pages, how you can map the URIs, and How you can route the URIs to custom ones.
  • Isolated storage and how you can use it for caching purposes, saving and retrieving files … etc.
  • Accessing computer devices like web cam and microphone from a Silverlight application easily.
  • Expression blend introduction and how it fits in the world of Silverlight.
  • How you can style your application in a very similar way to CSS in HTML pages.
  • How to animate objects easily and how to use Expression Blend for this purpose with some basic and nice examples.
  • How to create custom controls, although the book didn’t mention how to create user controls. It gives a very good example for building a custom control from scratch.
  • How Printing is so easy in Silverlight. You can print the screen as it is, or you can even customize the printable data to select portions of screen or even a whole new shape.
  • Finally, it talks briefly about important concepts and ideas you will need when you need to deploy a Silverlight application. It gives an idea about assembly cashing, out-of-browser mode, and elevated trust.

Really, I am recommending this book to any one who needs really to know what is the Silverlight about and what can do.

Thank you Apress for not wasting my time 🙂


    [tweetmeme  source=”aabdulmoniem” only_single=false]

    Today, our product owner has sent me a document which contains some bugs as he said. I have opened the document to see what are the problems with our system, but I have found that most of the notes which were named bugs simply not bugs but they are new features.

    I have decided to hold a meeting with him afternoon to discuss him about those notes. I told him: “These are not bugs, they are new features.”. He said sadly: “No, No … They are bugs. I didn’t expect all these notes. Why this feature is like this? and why the other feature is not working as my expectations … etc.”

    The problem I am facing here is just we are not meeting his expectations, and the cause is very obvious, he didn’t write his expectations about each feature. In other words, he didn’t write acceptance criteria for each user story (Scrum is our process).

    Rule of thumb:

    Always, ask your stakeholders about their acceptance criteria before going to code.

    Let’s take an example from Software Estimation book by Steve McConnell to see what I am talking about here:

    Suppose you’re developing an order-entry system and you haven’t yet pinned down the requirements for entering telephone numbers. If I didn’t ask the product owner about what he is expecting while entering telephone numbers, I may implement it in another way which will not meet his expectation. Some questions may be:

    • When telephone numbers are entered, will the customer want a Telephone Number Checker to check whether the numbers are valid?
    • If the customer wants the Telephone Number Checker, will the customer want the cheap or expensive version of the Telephone Number Checker? (There are typically 2-hour, 2-day, and 2-week versions of any particular feature—for example, U.S.-only versus international phone numbers.)
    • If you implement the cheap version of the Telephone Number Checker, will the customer later want the expensive version after all?
    • Can you use an off-the-shelf Telephone Number Checker, or are there design constraints that require you to develop your own?
    • How will the Telephone Number Checker be designed? (Typically there is at least a factor of 10 difference in design complexity among different designs for the same feature.)
    • How long will it take to code the Telephone Number Checker? (There can be a factor of 10 difference—or more—in the time that different developers need to code the same feature.)
    • Do the Telephone Number Checker and the Address Checker interact? How long will it take to integrate the Telephone Number Checker and the Address Checker?
    • What will the quality level of the Telephone Number Checker be? (Depending on the care taken during implementation, there can be a factor of 10 difference in the number of defects contained in the original implementation.)
    • How long will it take to debug and correct mistakes made in the implementation of the Telephone Number Checker? (Individual performance among different programmers with the same level of experience varies by at least a factor of 10 in debugging and correcting the same problems.)

    As we can see, some questions like this will give us more explanations about what he wants? and the first dialogue will not happen again if we meet what he looks for.

    A really good lesson you have to learn and to teach.


    [tweetmeme  source=”aabdulmoniem” only_single=false]

    Hello … It has been a long time from my last post. I am sorry for that delay (I know I am the only one who reads this :D).

    Really, I am here today just to describe my feelings about the last three months being a team lead. May be it is not the first time for me to lead some people but it is the first time actually I am titled as a team lead. And for sure it is a BIG difference.

    Being a normal senior leading some people under your management is totally different from being a team lead leading a whole team has seniors, juniors and even people who are out of your technical scope. And this makes the difference.

    Do you think it is easy?! .. Really not!

    In the past three months, I have realized really how to practice your mentality to be a multi-task enabled. You will meet situations that you have to lead people, write code, give advises, recommend solutions, architect software, be a Scrum master (if you are familiar with scrum), talk to managers, hold meetings, solve problems between team members, giving them positive boost, taking aggressive actions sometimes …. There is no more space to write all the tasks you have to do at the same time when you become a team lead.

    I will document here some notes I think they will be useful for someone else reading this topic (if any) and he is going to change his career soon to be a team lead.

    First, read on how to lead people in general and how to give them the right benefits and help they are needing from you. This is a  whole big different science and don’t try just to behave like a leader in your first day without gathering some information about your new position. A right choice for you may be “Peopleware” book.

    Second, from your first day in your new position you have to give your team the impression of how you’re a good team leader, set with them in a small session giving them some highlights about your career path, achievements, and success stories. Also, give them the ability to tell you the same about their career lives. It is important to make your team as a one unit, loving each other, and respecting each other, and knowing each other.

    Third, setup the process guidelines. You have to set the red and green lines which makes your work succeed with your team. You have to name the process on which your team will work together. Explain it very well, give examples about some situations you have seen in your career life, and at the same time tell your team members how they must be accountable and responsible while they are working because the team has the same vision so they must feel like they are making the job together to reach some targets.

    Fourth, you have to tell your team that the small tasks must be done perfectly for the sake of the big success. Because if the small tasks have been done perfectly, it makes a difference. So, your team members must feel how they are participating in success or failure. Success and failure will not be be attributed to a specific one, but to the team.

    Fifth, one of the biggest problems I have faced in my first days being a team lead is that some members have no intention to cooperate with others to make the team reaches the targets. The problem was that not all the team members know well how to be a good team player. Teach and direct your team members to be a good team players. Make some sessions about this issue every some time. It is really a big if not the biggest reason for your team success.

    hmm … I think, this is enough for today but certainly I will return back. I will be really happy to hear from all the team leads our there about their first moments being team leads ;).


    [tweetmeme source=”aabdulmoniem” only_single=false]

    We have discussed in our previous post the decorator pattern’s role, and giving a very detailed illustration about it. Also, we have discussed its design varieties and clarified when to use each design and why.

    Today, we will complete our discussion about decorator pattern. We will talk deeply about different examples from the real world cases to give you more deep understanding of this pattern. Also, we will discuss when to use this pattern in real world situations.

    We will demonstrate first a simple example and then move on to a more complicated ones and more variations.

    1 – Example: Use Case Diagram Tool

    Use case diagram is one of the fundamental diagrams of the unified modeling language (UML).  We use the use case diagrams to describe all the use cases a user can interact with within an application.

    Here, we will start to build a simple (Really, it is a very simple, just for demonstrations purposes) use case diagram tool.

    If we look more thoughtfully into the available shapes that can be drawn in a use case diagram, we will find them to be 3 main shapes:

    1. Actors.
    2. Use cases.
    3. Arrows (which represent relationships between actors, or between use cases or between actors and use cases).

    But a more deep look, we will find that each shape has a different look in a different situations.

    As described in the following diagram, some of the variations that could be applied to any shape during drawing process of use case diagrams:

    The challenge here that we want to build an application that covers all the variations available and with an ability to add more shapes in futures in case of any updates happens to UML.

    Here comes the magic of the decorator pattern. Let’s get started:

    Analyzing the last diagram shows us that we have 3 main shapes with different variations. Variations means here decorators which can be applied to different shapes to show us the right final shape.

    More analyzing, we are noticing that we have some kind of hybrid decorators like for example, dotted line with a tag. In fact, they are two decorators tag decorator and dotted line decorator.

    Let’s first start with one shape and then we will elaborate on this.

    IShape interface and Actor class:

    IShape Interface:

    public interface IShape
    {
         Bitmap Draw();
    }
    

    Actor Class:

    public class Actor : IShape
    {
         public Bitmap Draw()
         {
             Bitmap image = new Bitmap(200, 200);
    
             using (Graphics graphics = Graphics.FromImage(image))
             {
                  using (Pen blackPen = new Pen(Brushes.Black))
                  {
                       // Drawing head
                       graphics.DrawEllipse(blackPen, 100, 20, 20, 20);
    
                       // Drawing backbone
                       graphics.DrawLine(blackPen, 110, 40, 110, 80);
    
                       // Drawing arms
                       graphics.DrawLine(blackPen, 110, 55, 130, 55);
                       graphics.DrawLine(blackPen, 110, 55, 90, 55);
    
                      // Drawing legs
                      graphics.DrawLine(blackPen, 110, 80, 130, 100);
                      graphics.DrawLine(blackPen, 110, 80, 90, 100);
                  }
             }
    
            return image;
        }
    }
    

    If we try now to use this class with a windows forms application in .NET for example you will write just like the following code after dragging a picture box into the form:

    Actor actor = new Actor();
    pictureBox1.Image = actor.Draw();
    

    Run the project, you will see:

    Now we need to add some sugar, so let’s add a decorator called TagDecorator which will be responsible for adding tags (titles) to any shape.

    Here is the class diagram (following the guidelines of decorator patterns):

    TagDecorator Class:

    public class TagDecorator : IShape
    {
         private IShape _shape;
         private string _tag;
    
         public TagDecorator(IShape shape, string tag)
         {
              _shape = shape;
              _tag = tag;
         }
    
         public Bitmap Draw()
         {
             // Getting the actor shape without tags
             Bitmap image = _shape.Draw();
    
             // Writing the tag under the actor shape
             using (Graphics grahpics = Graphics.FromImage(image))
             {
                  grahpics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                  StringFormat stringFormat = new StringFormat
                  {
                       Alignment = StringAlignment.Center,
                       LineAlignment = StringAlignment.Center
                  };
                  grahpics.DrawString(_tag, new Font("Times New Roman", 12), Brushes.Black, new RectangleF(10, 110, 200, 20), stringFormat);
             }
    
             return image;
         }
    }
    

    Let’s try to draw this decorated actor to the form. So we will write this code:

    Actor actor = new Actor();
    TagDecorator actorTag = new TagDecorator(actor, "User");
    pictureBox1.Image = actorTag.Draw();
    

    And see the output:

    Now let’s make things more complicated, I will just give you the concepts and let you try to implement them.

    What if we want to add more shapes, simply we will use the following diagram:

    What about more decorators?!

    Go, and try to build you own diagramming tool.

    2 – Real World Examples

    Now we will demonstrate some real world examples may be we are using in a daily basis but we don’t know.

    In a very good article by Rob Pierry, he discussed when a decorator pattern has been used within .NET. He Said:

    “Any useful executable program involves either reading input, writing output, or both. Regardless of the source of the data being read or written, it can be treated abstractly as a sequence of bytes. .NET uses the System.IO.Stream class to represent this abstraction. Whether the data involves characters in a text file, TCP/IP network traffic, or something else entirely, chances are you will have access to it via a Stream. Since the class for working with file data (FileStream) and the class for working with network traffic (NetworkStream) both inherit from Stream, you can easily write code that processes the data independent of its origins. Here’s a method for printing out some bytes from a Stream to the console:

    public static void PrintBytes(Stream s)
    {
         int b;
         while((b = fs.ReadByte()) >= 0)
         {
             Console.Write(b + " ");
         }
    }
    

    Reading a single byte at a time is typically not the most efficient way to access a stream. For example, hard drives are capable of (and optimized for) reading continuous blocks of data from the disk in a big chunk. If you know you are going to be reading several characters, it is better to read a chunk from the disk all at once and then consume the chunk from memory byte by byte. The Framework includes the BufferedStream class for doing just that. The constructor for BufferedStream takes as the parameter whatever stream you would like buffered access to. BufferedStream overrides the main methods of Stream, such as Read and Write, to provide more functionality. Since it is still a child class of Stream, you can use it the same as any other Stream (note that FileStream includes its own buffering capabilities). Similarly, you can use System.Security.Cryptography.CryptoStream to encrypt and decrypt Streams on the fly, without the rest of the application needing to know anything more than the fact that it is a Stream.

    This ability to dynamically attach new functionality to objects transparently using composition is an example of the Decorator pattern”.

    This is valid also for Java developers as well as far as I know in java.io namespace.

    Let’s also demonstrate a more general real examples:

    Here are four ways the Decorator pattern is used in the real world (Excerpt from C# 3.0 Design patterns):

    • As our small example illustrated, the Decorator pattern fits well in the graphics world. It is equally at home with video and sound; for instance, video streaming can be compressed at different rates, and sound can be input to a simultaneous translation service.
    • At a more mundane level, decorators abound in the I/O APIs of C# as illustrated.
    • In today’s world of mobile devices, web browsers and other mobile applications thrive on the Decorator pattern. They can create display objects suitable for smaller screens that include scroll bars and exclude banners that would be standard on desktop display browsers, for example.
    • The Decorator pattern is so useful that there are now actual Decorator classes in .NET 3.0. The one in System.Windows.Controls “provides a base class for elements that apply effects onto or around a single child element, such as Border or Viewbox.”

    3 – When to use?

    When you have:

    • An existing component class that may be unavailable for subclassing.

    Or When you want to:

    • Attach additional state or behavior to an object dynamically.
    • Make changes to some objects in a class without affecting others.
    • Avoid subclassing because too many classes could result.

    4 – Finally

    At last, we have finished demonstrating this pattern. Our next one is Proxy pattern. So, be with us 🙂


    [tweetmeme  source=”aabdulmoniem” only_single=false]

    Hello! Back again, it has been a while from our last review on this great book, Software Estimation.

    We have already reviewed the first part of the book which discusses the critical concepts about software estimation.

    Now, we are moving on to another stage. This book now turns to a discussion of detailed estimation techniques that can be applied to specific estimation problems.

    This chapter is just an introduction to lay out the ground for the upcoming chapters which will discuss specific techniques.

    What I have learned?

    • There are many considerations you have to take into account before choosing the right estimation technique to your specific problems.
    1. What is being estimated?
      • Do you have features, and you want to  estimate schedule and effort?
      • Do you have budget and development time frame, and you want to estimate how many features can be delivered?
      • In this book, estimating size refers to estimating the scope of technical work of a given feature set—in units such as lines of code, function points, stories, or some other measure. Estimating features refers to estimating how many features can be delivered within schedule and budget constraints. These terms are not industry standards; I’m defining them here for the sake of clarity.
    2. Project Size
      • Small: <= 5  total technical staff. Best estimation techniques is “bottom -up” techniques based on estimates made by individuals who will do the job.
      • Large: >= 25 people lasts for 6 to 12 months or more. Best estimation techniques are in the early stages, the best estimation approaches tend to be “top-down” techniques based on algorithms and statistics. In the middle stages, a combination of top-down and bottom-up techniques based on the project’s own historical data will produce the most accurate estimates. In the later stages of large projects, bottom-up techniques will provide the most accurate estimates.
      • Medium: 5 to 25 people and last 3 to 12 months. They have the advantage of being able to use virtually all the estimation techniques that large projects can use and several of the small-project techniques, too.
    3. Software Development Style
      • For purposes of estimation, the two major development styles are sequential and iterative. Industry terminology surrounding iterative, Agile, and sequential projects can be confusing. For this book’s purposes, the primary difference between these kinds of projects is the percentage of requirements they define early in the project compared to the percentage they define after construction is underway.
      • Evolutionary prototyping: Iterative.
      • Extreme Programming: highly iterative.
      • Evolutionary delivery: normally practiced as iterative.
      • Staged delivery: Sequential.
      • Rational Unified Process (RUP): Sequential.
      • Scrum: Iterative from multi-sprint point of view.
    4. Development Stage
      • Early: On sequential projects, the early stage will be the period from the beginning of the project concept until requirements have been mostly defined. On iterative projects, early refers to the initial planning period.
      • Middle: It is the time between initial planning and early construction.
      • Late: Refers to the time from mid-construction through release.
    5. Accuracy Possible
      • The accuracy of a technique is a function partly of the technique, partly of whether the technique is being applied to a suitable estimation problem, and partly of when in the project the technique is applied.

        Some estimation techniques produce high accuracy but at high cost. Others produce lower accuracy, but at lower cost. Normally you’ll want to use the most accurate techniques available, but depending on the stage of the project and how much accuracy is possible at that point in the Cone of Uncertainty, a low-cost, low-accuracy approach can be appropriate.

    • Most of the remaining chapters in this book begin with tables that describe the applicability of techniques in the chapter. Here’s an example:
    Applicability of Techniques in this Chapter—SAMPLE
    Group Reviews Calibration with Project-Specific Data
    What’s Estimated Size, Effort, Schedule, Features Size, Effort, Schedule, Features
    Size of project – M L S M L
    Development Stage Early—Middle Middle—Late
    Iterative or Sequential Both Both
    Accuracy Possible Medium—High High

    [tweetmeme source=”aabdulmoniem” only_single=false]

    Another new feature in C# 4.0 is covariance and contravariance. Really, I will let you in this post with those two nice videos which explains well what is this new feature. This video is made by Eric Lippert divided into two parts. Enjoy!

    How Do I: Use Covariance and Contravariance in VS 2010 Part I?

    How Do I: Use Covariance and Contravariance in VS 2010 Part II?

    I really do like the new feature because it didn’t break the main theme of C# that is strongly typed language.

    Also, I like the semantics behind the in and out keywords when used in this new feature.

    Finally, I don’t have to cast each element in IEnumerable sequence coming from LINQ to return a sequence of some related class, it will be done for me at compile time out of the box! Great!

    %d bloggers like this: