Coffee, smoke and Techilicious Burps at 3.47 AM Headline Animator

Tuesday, September 8, 2009

UML 101

So you need to read the entire UML book in 20 minutes. What do you do? These are the excerpts from the Unified Modeling Language Reference Manual I was reading and thought I could summarize for a quick refresh.

 

clip_image002

Aggregation and composition:

clip_image004

Generalization:

clip_image006

Kinds of dependencies:

clip_image008

clip_image010

Use case diagram:

clip_image012

Kinds of Use Case relationships:

clip_image014

clip_image016

clip_image018

clip_image020

clip_image022

clip_image024

clip_image026

clip_image028

Activity Diagram:

clip_image030

clip_image032

Sequence diagrams and Activation:

clip_image034

clip_image036

clip_image038

Component Diagram:

clip_image040

Deployment Diagram:

clip_image042

Packages and relationships:

clip_image044

Tuesday, August 18, 2009

Left outer join in Entity Framework

This evening I heard someone say that Left Outer Joins are not possible in Entity Framework or perhaps Left Outer Joins are possible, but they bring in all the data and then filter out the right table.

I felt an urge to argue, but I resisted. I thought I would investigate before I waste time. I came up with some articles pretty quickly.

I am sure these should resolve all questions related to Left Outer Joins.

Now about the performance and the question about how the data is brought, I am pretty sure we can prove that LINQ Queries all support deferred execution. But we can always prove that using the SQL Query Profiler.

Hope this helps.

Wednesday, July 29, 2009

Singleton Vs. Static Class

Well I was asked this question once. “What is a singleton design pattern and why should I use it? Why not use a static class instead?”

And it was quite surprising how it went. I said that Singleton is used when you need to maintain state. Static classes are used when you want to club together a bunch of stateless methods that do something irrespective of which instance calls these methods. Math class is a good example.

So he asked me, can I not maintain state in a static class? So I said if you want to instantiate something in a static class how would you do it? And surprisingly he told me that he would do it in a static constructor. I asked him, is it possible to instantiate anything in the static constructor imageor even declare an instance type in a static class? And he asked me is it not possible? I said it is not as far as I know and he asked me if I am sure.

Now the way the questions were asked about this subject, I was quite surprised. The interviewer looked quite convinced that instance types can be declared in a static class. I am surprised how he was allowed to take the interview in the first place. Or was he checking my confidence?

I wonder.