Raba - Defend your code RSS 2.0
# Monday, April 14, 2008

Almost a week after tech-ed but It's better late than never.
Very early this morning we start our way to Eilat, the gang of four I called it, Gabbi Soler (aka. MC. Soler), Doron Yaakobi, Yoav Michaeli and I.

     Night before TechEd                   Doron at the morning of The first day

This 5 hours were tremendous, sunny day, cool partners and great subjects for talking, we argued almost about everything, the only thing we agreed about is that we are not agree about anything. Here are some of the subjects for debates:

  • Design using UML VS. Test driven Design Vs. Word-API-design
  • SOA as a one-entrance-point to (varying) many applications Vs. One Big Application
  • Project management - what are the management differences between a small project to a large(huge) one - from  scrum-lovers point of view

The next 3-days are going to be a great fun, as a beginning enjoy the view:

                            The Beauty of Israel #1 - on our way to Eilat

                                 The Beauty of Israel #2 - Still on our way to Eilat...

After almost 5 hours of driving (by Yoav) we finally got to Eilat, at the registration point we got a laptop-bag as a welcome-gift and we went to the opening plenum.
Than we finally start learning, here are the 3 lectures I chose to be at for my first day:

Odyssey in SOA - A Voyage through (by Manu Cohen-Yashar)
Manu explained about the SOA using the MS Tools around us, there are plenty of them and I am sure that such lecture is a great start for the SOA & S+S 3-days-session.
Some of the buzz that were thrown out there are: using ESB for Dynamic routing instead of coding that solution by yourself, I've heard for the first time about ISB - Internet Service bus and Oslo as MS-new-to-come solution. Manu also demonstrate a cool tool by AmberPoint here are some of their products: SOA Monitoring, AmberPoint Express.
Those products can show you everything you would like to know about your services even time of calling, number of errors and flow of calls of each message, this tools can solve many problems when using WF & WCF together. anyway I like the lecture, it was a good start for me cause we are start using WCF & SOA in more places at our systems. anyway there were samples that I wanted to see its code or WF Creations it could be even clearer than its explanations.
My grade to Manu's lecture: 8/10.


SOAP\WS* and REST (by David Chappell)
David Chappell had a great show at teched He is a great presenter and he knows how to take some boring subject and make it interesting.
The lecture was talked about the two approaches for Web-Services, the WS* approach and the Rest API. When using WCF you are using, in generally, the WS* approach, with this approach we can choose to use the Reliability, Transactions, Policy etc., but we never asked whether we really need all this stuff in our Web-Services? If your answer is not, so why won't we decrease the size of the request and the response and have something more human-readable such as: REST, (you can read more here).
You can use the simply URI and HTTP methods (Get, Post, Delete etc.) and get back a simple XML, RSS, Json etc. there is no need to send or receive Soap Messages.
In WCF you can easily use the WebGet, WebInvoke, and the ResponseFormat property. I Recommend you to search for the lecture presentation, I would post here link when I'll find it, anyway this is what he said as a conclusion: Rest - can be a good  choice for exposing data over web services, SOAP - can be a good choice for exposing logic\operation.

David Chappell
                      David Chappell in Action - Explaining its lecture agenda.

My grade to David's lecture is 10/10, maybe this is because of the accent-charm but it is a must lecture for those who want to learn about the REST and the WCF connectivity.


SQL Server 2008 - what's new in Analysis services
I believe in knowledge, I also believe in learning more tools\products\architecture, so I went to this lecture from the BI session, after half an hour I've found this boring while the presenters only compare between the 2005 to the 2008 version, so I can't even give a short description from this one.

        This is me picturing myself, before the cocktail party (or maybe after...)

After this lecture we went to the cocktail party where I first found Oren Ellenbogen and Aviel. I really missed Oren and it was great to see him and lots fun with them both.

More on the second day at my next posts.

Monday, April 14, 2008 7:51:47 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
.Net 2.0 | SQL Server 2005 | WCF

# Tuesday, March 18, 2008

I've read Avi Wortzel's great post "Host Multiple services in windows service". Avi create his own Windows Service which on start knows to also start other services such as: Simple Windows Service and WCF Service.
At my place one of my developers, Elad (blog-less), wrote a spike for running our own Windows Service which can manage all Wcf Services in a given dll, (we didn't like the usage of IService which cause us to change the Wcf Service and implement a specific methods for windows - while the WCF team works hard to cause the framework to be generic to all hosts) . In Elad's solution we will iterate over the dll's classes which had the [ServiceContractAttribute] above it. And now: while turning on\off the main (windows) Service it will also start\shutdown all existing WCF Services.

Today I dig a little bit the MSDN and the IDE directory and found WcfSvcHost.Exe which also knows to start\stop all Wcf Services in a given DLL.
This one is great, it even had its own UI to manage each service by itself.

running WcfService using WcfSvcHost
                        Here you can see me running Wortzel's WcfService using WcfSvcHost.exe with no code written at all.

I didn't test the whole functionality of this application, but it looks good enough for your basic services and samples, I still believe that on sophisticated scenarios we will still need to use Avi's-like-code.

Tuesday, March 18, 2008 11:18:30 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
.Net 3.5 | WinFX | WCF

# Monday, March 17, 2008

Next Month: 6-8 April, I'll participate at Teched.

I can't wait to meet the people and talk about technology, I invite you to communicate me using "Face2Face Meeting Service"

press the image below to redirect to the Face2Face Meeting Service

You can also leave a comment at my blog or contact me by Email.


Here are some of the subjects I am working with on  a daily basis, let's talk about it:

  • .Net & Architectures (WCF, Code Generators, LINQ, ASP.Net MVC, Silverlight)
  • Team foundation server (Scrum Templates, Continuous Integration, Daily Build)
  • Agile development (Scrum masters, TDD, Pair programming)
  • GIS (ESRI, Alt-ESRI, ArcGIS Explorer)


Let's Talk-Ed.

Monday, March 17, 2008 10:15:13 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
Life | My Site

# Monday, March 03, 2008

There is a new (google) group for the ArcDeveloper.Net (or may we call it Alt-ESRI)
Help us to give you a better API.

Monday, March 03, 2008 9:39:07 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
.Net 3.5 | GIS | ArcGis Server | Software Development | WCF

Last Thursday Nati & I gave two days lecture (as I've already talked about last week)

The first was day dedicated to explain SOA buzz & the WCF basic samples to resolve the plumbing's Hell.
The second day was dedicated to a deep_WCF_dive.
We also had two Hands On Labs samples to assist the students in practicing the daily issues.

Here you can find the two presentations (day #1, day #2) you can also read more about the two days course at Nati's post.

For me it was the first time doing such lecture & HOL - I had a great time and would probably do it again...


The presentations were inspired by:

Monday, March 03, 2008 9:20:12 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
Life | WCF

# Friday, February 22, 2008

This post is a test case


   1: using (AddIn.CodeSnippet())   
   2: {   
   3:     TestThisMethodInMyBlog();
   4:     I.HopeItWillFinallyWorkInBothBlogAndRssReaders();
   5: }



Hope it will work

Friday, February 22, 2008 4:58:09 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
My Site

Next week Nati & I going give a two days lecture (& hands-on-labs) about WCF.
I am setting some good tools on my laptop for the presentation, Here is part of the list I've installed till now:

  1. TestDriven.net: http://www.testdriven.net/
  2. ZoomIt v1.72:  http://www.microsoft.com/technet/sysinternals/Miscellaneous/ZoomIt.mspx
  3. ToDo List 2 - for organizing my tasks: http://www.codeproject.com/KB/applications/todolist2.aspx
  4. Cool Commands 4.0 (Vs 2008):

I am still looking for more cool tools.
feel free to leave a post about more cool tools - for a better show (presentation).

Friday, February 22, 2008 12:17:39 AM (GMT Standard Time, UTC+00:00)  #    Comments [2] - Trackback

# Monday, February 11, 2008

I've tried to write a simple code today GetEverythingButTheFirstElement() -> a code that get the all elements but the first one.

of course I've started with the old fashioned way:

   1:  string[] firstOne = new string[args.Count() - 1];
   2:  for (int i = 1; i < args.Count(); i++)
   3:  {
   5:      firstOne[i - 1] = args[i];
   7:  }

Now I've start refactoring it to something more C#3.0-able and it looks like this one:

   1:  // The method to use as the predicate for the where
   2:  public static bool GetAllElementsButTheFirstOne(string s, int i)
   3:  {
   4:      if (i == 0)
   5:          return false;
   7:      return true;
   8:  }
  10:  //The usage at my code
  11:  IEnumerable<string> secondTemp = args.Where(GetAllElementsButTheFirstOne);

Here happen something strange, the secondTemp do not hold objects in it, looks strange? no! it uses a lazy load thanks to the Linq defaults, so I've added this line at the end:

   12:  string[] secondOne = secondTemp.ToArray<string>();

So I decided to refactor this code a little bit more, I didn't like the string that the Where() force me to write, so I've added my own Where:

   1:  public static class Extensions
   2:  {
   3:      public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<int, bool> predicate)
   5:      {
   6:          for(int i=0; i < source.Count(); i++)
   7:          {
   8:              if (predicate(i))
   9:                 yield return source.ElementAt(i);
  10:          }
  11:      }
  12:  }

This looks awesome now I can write it just like this:

   1:  public static bool GetAllElementsButTheFirstOne(int i)
   2:  {
   3:      if (i == 0)
   4:          return false;
   5:      return true;
   6:  }

But Hey, what do you think about this code?

   1:  IEnumerable<string> thirdTemp = args.Where((int i) => { return i > 0; });

Haaa, now it looks good.

This is not the first time I am writing lambda expression but I still thinking to my self how much I should read&code so this will be my natural way of thinking... for now it take me more time to write it than in the casual way.


Monday, February 11, 2008 11:32:49 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
C#3.0 | LINQ

We are using the ArcGis Explorer as our 3d-Browser, and we would like to create a task.config file for each task. You can read more at my last post about Load config file dynamically (here).

Why this Architecture good for us?
Every one can install its explorer on his computer without any problem, we would like to add our own Task-Specific configurations for example: server-names to connect to, task-screen-size, links to web sites etc.
first, such details you cannot be save to the AGX-installation directory because it already installed. second, we would like to send them again and again every time the task will be updated and downloaded.

Any way, after reading this we still have two questions to answer:

1) how to get to the tasks directory
2) how to find our specific task

The answers for those questions are pretty simple:
1) To get to the task directory you should use this parameters:

   1:  Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\ESRI\ArcGIS Explorer\Tasks";

This answer will solve you the "how to found the tasks directory programmatically" but you'll still have to find the specific task directory that is interesting you.
Anyway, this is good but not good enough. I would like the E2 API to give me its Environment parameters and not to force me to code it by myself. It smell like something that can be change... and I'll be glad if the people at the ArcGis Explorer will create something like: public static class E2Environemnt which will implement such property. For now: we implement our own Environment extensions.

2) To Find the specific task you should dig the black box of E2 and you will find this cool factory:

   1:  ESRI.ArcGIS.E2API.E2TaskFactory factory = new ESRI.ArcGIS.E2API.E2TaskFactory();
   2:  string taskDirectoryName  = factory.GetTaskSubfolderNameFromAssemblyName(currentTask); 

So What's the catch I've asked? This is an internal implementation, ESRI don't like you if you'll use it... (you can read more about my question in the AGX forum). And I will ask just one simple question, why?! why not to make it internal or even private class. why we should read it at the XML comments?!

And here is my preferred solution (as Rob answered in the ArcGis Explorer forum), it make the job for me right now and it is the simple way to do it:

   1:  System.Reflection.Assembly.GetExecutingAssembly().Location;


Monday, February 11, 2008 6:10:38 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
.Net 2.0 | GIS | AGX | Software Development

There are time you would like to load your configuration data from a specific config file or maybe even from the config file but not from the main one, I'll explain it using an example from the real world (last week refactoring).
We have many client which run the ArcGis Explorer (AGX) client (Geographic application like Google Earth), this client can be installed on each and every client, and it has its own configuration files. Within our team we write tasks that running on that AGX. while opening the application it will download to your profile directory the relevant DLL's for running those tasks. but hey those DLL's will be in a separate directory, neither in the GAC nor in the AGX executable directory. You can find many examples for such scenarios.

Here you can see the two different directories: one for the E2.exe and its config file, and the specific task DLL's and its config file (Sample.dll.config)

All we wanted to make is a Task specific configuration. so we would like it to work on every other task we will create.
First you might know this bunch of code, this will help you load the Sample.dll.config file from the wanted directory (The Task directory).

   1:  // Get the application configuration file path.
   2:  string exeFilePath = @"C:\ShaniData\Projects2008\ConfigHandlerDemo\Sample.dll.config"; 
   4:  // Map to the application configuration file.
   5:  ExeConfigurationFileMap configFile = new ExeConfigurationFileMap();
   6:  configFile.ExeConfigFilename = exeFilePath;
   7:  System.Configuration.Configuration config =
   8:  ConfigurationManager.OpenMappedExeConfiguration(configFile,
   9:  ConfigurationUserLevel.None);
  11:  ConfigurationSection sec = config.GetSection("MailManagerConfiguration");

In this situation we should use the .Net default ConfigurationSection implementations (for example: the ApplicationSettingsSection). Those of you who think of using the DictionarySectionHandler or NameValueSectionHandler will found it returning the DefaultSection instead.

Pay also attention that your code is running from the AGX installation directory so if you'll write your own section it won't work unless it was installed on the given computer (in GAC or in the AGX installation directory).

Monday, February 11, 2008 3:38:38 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
.Net 2.0 | GIS | AGX

Following my last post about LINQ, Expression Trees & Lambda Expressions I've found this Linq Quiz:

C# 3.0 in a nutshell - LINQ Quiz

Try yourself to see what your is your level and where you can get if you read\code more of this stuff (tip: C# 3.0 in  a nutshell is a great book)


Monday, February 11, 2008 3:13:29 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback
C#3.0 | LINQ

# Sunday, February 03, 2008

James, Dave & Doron wrote about the ESRI's API, you could read it here:

  1. Doron's post about replacing the Web-ADF
  2. James Fee - posting about replacing the ADF
  3. Dave Bouwman posting about James & Doron  posting about replacing the Web-ADF

I might add my post, for calling you all GIS Bloggers to help us (in Dave's idea) to create an ALT-ESRI API.
I'll be write even more in the near future...

Sunday, February 03, 2008 11:49:56 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] - Trackback

<April 2008>

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2015
Shani Raba
Sign In
Total Posts: 146
This Year: 0
This Month: 0
This Week: 0
Comments: 97
Cool Stuff
Add to Technorati Favorites
Pick a theme:
All Content © 2015, Shani Raba
DasBlog theme 'Business' created by Christoph De Baene (delarou)