DCSIMG
April 2006 - Posts - ISerializable in Israel

April 2006 - Posts

My upcoming Tech-Ed Talk in Israel will be all about what’s new and Cool in .NET 2.0 Reflection. Over the coming weeks until TechEd, I’ll supply links and information detailing the stuff I’ll be talking about.

For the past three weeks or so I’ve been totally immersed in Reflection-Land.

There are seriously cool things going on behind the scenes, and, frankly,  I was surprised at the amount of new stuff that is now possible.

One of my favorite features is the new ability to reflection over a Method’s Body. That is, get the actually IL for the method in the form of a Byte Array. You can then parse the IL and do what ever you want with it (including building your own version of reflector, for example).

This is possible due to a new API added on the MethodBase class, called: “GetMethodBody()”. You can then use the resulting “MethodBody” object and invoke it’s “GetILAsByteArray()” method.

 

It’s really quite simple.

Parsing the Byte Array is a different matter, though. I’ll talk about that in a future post. For now, suffice to say that you can do wonderful things once you have the IL.

You can basically get the IL from any MethodInfo object at runtime and parse it (for security reasons, you might wanna make sure that there are no method calls to a specific method from any plugin you are about to load)

 

I was also able to create a MethodInfo Debugger Visualizer, based on the code released here by a guy from the Reflection team. His visualizer shows the IL for a DynamicMethod object at debug time (that’s also a new class I’ll talk about in a future post). It took me a day or so to figure out how to extend it to show the IL for any method info object during debugging, and it works quite well!

In fact, you can now write a method that writes its own code in IL J

 

All that and more, in the near future, I promise J

Meanwhile, here’s a nice post form Joel Pobar, highlighting some of the new features in Reflection 2.0. I’ll be elaborating on these more, but you can follow the links on his post as well to discover a whole new world of possibilities.

Posted by Royo | with no comments

Looks like there's another .NET user group being born in Israel these days - The Tapuz .NET Prgramming Forum User Group.  (click the link for the official announcement and instructions on how to get there). Heck, I'd just call it "The Tapuzer Group" ..:)

 

 The group meets on May 29th at the Microsoft Facility in Ra'anana. I'll be there, just to see this energized group of people who in real life I haven't really had a chance to meet at any of the other .NET user groups or seminars or MS conferences out there.

 

The guy leading this effort is none other than new MVP Justin Angel, who's been one of the most active members on the Tapuz .NET Forum.

 

Personally, I have mixed feelings about this.

On one hand, I think it's great to see a community that has existed solely "on paper" meet finally, and actually getting together to discuss topics and goals for themselves. Community is a great thing and I believe that doing things together leads to a great sense of friendship and learning.

 

On the other hand, that user group will be added to an already very large number of .NET-related user groups here in Israel. off the top of my hat I can think of the VB User group, the C/C++/C# user group, the Security User Group, the .NET Architects user group, Embedded and Mobile group, and I know of one other attempt at creating what is some sort of a "Development Manager User group". That's not mentioning 8 or more other groups related to MS technology. Each of these meets monthly, at some other day of the month.

 

What's the problem with that, you may ask?

All these communities mean there's a lot to learn and lots of people to meet, isn't it? well. here's the thing. Israel is a very small place. 98% of these user groups meet in the center, near or in Ra'anana.

If I wanted to attend all of these meetings (which I usually do), I'd at least one day of each week getting out of work early to be there by 17:00. Some weeks this means two days during that week.

 

The average developer usually does not allow himself such long-standing privileges as going "home" early 4-8 days a week. SO the essentially need to choose which group they'd like to get to. That's still not a bad situation since right now, most of the groups are very divided in topics. But once you have 4-5 .NET related groups (My Agile group deals a lot with .NET technologies since that's what the crowd is interested in these day) you can't help but overstep each other's bounds.

 

Having the same amount of people distributed over a larger amount of user groups just means less people in each meeting, smaller and more divided communities and more effort spent on organizing these things than to just get together and learn the same topics in less groups.

 

Another issue is the amount of able presenters in Israel. Let's face it - we're a very small puddle, where everyone knows everyone else. I see the same set of speakers at *all* the .NET user groups, basically in a sort of rotation (me included). It's very rare to see a fresh face speaking at a user group. I wish it was different, but it's not. I'd like to see the Tapuz community integrated into *existing* communities rather than spending time with its own self. I bet there are people there who cold be presenting at the various .NET user groups, bringing new blood into the mix, a fresh face, and some fresh topics.

 

Instead, anyone who wants to hear or see something different will have to try and find a way to make *yet another* date where they get off work early, just so they won't miss the next interesting lecture from someone they haven’t gotten to hear before.

 

That's a sad state of affairs, and i believe that although Justin is doing a good thing, he could have done an even better one by arranging the Tapuz group to meet at one of the existing .NET user groups and use that group as a podium to discuss the various interesting topics they have (and they do!)

 

Last but not least, if you're thinking that me owning a user group is somehow to do with my faint objection to the new one, you're wrong. I'd object just the same regardless.

 

All that being said, I've already mentioned that I’m planning to attend the Tapuz meeting. I wouldn’t want to miss any interesting tidbits..

 

 

Posted by Royo | 3 comment(s)
Justin, a new MVP, blogs in the new Microsoft Israeli Blogs site (Hebrew and English Mixed) about a pricing comparison he made when deciding to purchase some books he needed. He has some nice price comparison results with a graph and an interesting conclusion: you can pay half of what you are paying today if you pay attention!
(post is in Hebrew)
 
Nice work!
Posted by Royo | with no comments
Ralf has a nice tidbit about how .NET 2.0 Partial Classes can help you with writing unit tests for methods on classes that are otherwise harder to get to.
It's a nice trick to add to the trick bag, though I'd argue that if you were doing Test-Driven-Development in the first place, you'd have a testable design out-of-the-box, and you wouldn't need to come up with clever hacks such as these.
Having said that, sometimes you just don't have a choice and you need to write tests for legacy code (a.k.a "code that works"), and in that case, this just might be a lifesaver.
 
Another lifesaving tool to use with your legacy code would be TypeMock. I recommend you take a long hard look at that little miracle of a tool (which was recently transferred into Israeli ownership, BTW) that can help you overcome lots of legacy code coupling issues in your tests. I should do a whole article on that when I get the time..
Posted by Royo | with no comments
תגים:
In VB6 you could easily create a COM+/MTS object on a specific server by using CreateObject(progId, serverName).
Corrado Cavalli, an MVP, just pointed this snippet showing how one would do the equivelant of that in .NET:

Dim t as Type=Type.GetTypeFromProgId(progid, servername)
Dim o as Object=
Activator.CreateInstance(t)

Here's a C# version for the VB-Challenged..

Type t = Type.GetTypeFromProgId(progid, servername)
Object o=
Activator.CreateInstance(t)

Posted by Royo | with no comments
Earlier this month, My friend Oren Ellenbogen contacted me saying he'd like to do a talk in one of the upcoming user groups here in Israel about .NET about the advanced used of delegates and generics in .NET applications.
I referred him to the C# and VB user groups and surely enough, he'll be speaking at the upcoming C# user group meeting next month.
 
(speaking of user groups, a little bird tells me that a new user group is forming in Israel, for development managers. Shhh. you'll here more in the coming months)
 
I recommend VB.NET developers who know how to read C# code go just as well. It's all the same underneath the covers anyway..
Here's the excerpt from the group site (it's free to just show up, BTW)

Date:    Wednesday, May 17, 17:00 - 20:00

Place:   Microsoft Israel 

            Hapnina 2  (Amdocs Building)

            Ground Floor

            Raanana

+972 (9) 762-5100         

 

Parking available at the Kurkar parking lot. Proceed straight past the traffic circle and the parking lot will be on your right.

Topic: Advanced Use of Delegates and Generics

Lecturer: Oren Ellenbogen

 This lecture will not be just about Delegates or Generics, but it will combine those topics to show you how you can leverage to usability of those semi-new features. Oren will discuss the receiving of delegates as parameters and the implementation of abstraction in this methodology. He will tie the two topics together by refactoring(live!) existing code using a principle he calls “Code Templating”;  a coding method that allows running unique logic within recurrent code.

 Agenda:

  1. Looking at a "simple" scenarios of recurrent code
    1. Check if a value exists in a collection.
    2. Get the item index in a collection.
    3. Filtering a collection (get only some of the items based on a condition).
    4. Manipulating every item in the collection (string concatenation for example).
  2. Looking at "advanced" scenarios of recurrent code
    1. Querying the database.
    2. Exception handling.
  3. Discuss solutions for further abstraction in those scenarios.
  4. Introduce "Code Templating" – separating the unique code from the recurrent code.
  5. Before we start, getting to know our toolbox: generics & delegates
    1. What are they?
    2. Calling a delegate which was given as parameter – understand the benefits.
    3. Anonymous delegates\methods – how & why
    4. What's going on under the hood?
  6. Examples of Code Templating in .Net 2.0
    1. Handle those "simple" scenarios via List<T>.Find, List<T>. FindAll, List.<T>.Exists etc…
  7. Refactor (live!) the "advanced" scenarios, step-by-step.
  8. Code Templating - What do we gain? What can we lose?
  9. Q & A

 

Oren Ellenbogen is a Team Leader at SQLink's R&D Department. Oren's responsibilities and areas of expertise span from Analyzing and Designing Web Applications to developing innovative coding enhancement tools. Oren's project leading at SQLink involves all stages and forms from team leadership to high level consulting.

 Oren's years of developing experience cover a variety of languages including PHP, C++, VB6 and C#.

 Oren published a series of articles at codeproject.com, publishes a programming oriented blog and is an active member of several .Net architects forums.

 As always, although admission is free and you may attend without reserving a place, we kindly request that you notify us if you plan to attend so that we can be sure to have enough chairs and FOOD!

Posted by Royo | with no comments
Update: Anonymous Comments are now enabled on this blog
 
My name is Roy Osherove and I'm a Microsoft MVP here in Israel.
I'm also speaking at the upcoming Microsoft Tech-Ed Conference, so I hope to post my thoughts and tribulations about my presentation here as they happen.
 
My Original Blog
My original blog is located at www.ISerializable.com , and I plan to be cross-posting to that blog through this one.
 
What links should I bookmark?
 
Where do you Work?
I'm the Principal of Team Agile, consulting and teaching .NET Architecture, Agile development and best practices for software development (.NET is only part of it. I also do Java, C++ and VB). If you're interested in listening to some of the .NET and Agile related audio interviews I've done in the past, just head on over to my company's interviews page and download as much as you like. Should be loads of fun to download, burin to a CD and listen to in your car.
 
Why aren't you writing in Hebrew, Roy?
Good question. I just type quicker in English. I type like a moron in Hebrew. That's why.
 
What's your blog about, then?
My blog will be about .NET Development, Agile Development and life under the shadow of the MVP program.
 
And you look like..?
this.
Posted by Royo | with no comments