| Sergey's profileSergey ShishkinBlogLists | Help |
Sergey Shishkinsoftware + people
6/23/2010 .NET Open Space Süd in KarlsruheEnvy me, I spent last weekend in Karlsruhe with some of Germany’s smartest and most passionate .NET developers. Big thanks for that to organizers of the .NET Open Space Süd and all the participants. I feel inspired and am full of ideas again. The anti-conference started for me with a great functional programming session with @sforkmann introducing Monads. The topic was so great that immediately after the session many attendees started implementing the Maybe monad in C#. And monads accompanied us all the weekend in all sort of jokes :) Functional programming continued with a session on Reactive Extensions, where I introduced the framework as a new way of doing .NET events and async programming. After that @sforkmann supported the topic with JavaScript samples and an introduction of IQbservable followed by a great discussion. Two sessions were focused on software specifications, BDD, and ATDD. I was representing ATDD and FitNesse camp, however to be more effective I should bring more hands-on examples to break through code-centric developer heads :) Anyways, the “BDD Shootout” session was really inspiring and code-intense. Not a big surprise with people like @agross (MSpec), @sforkmann (NaturalSpec), and @BjoernRochel (XUnit.BDDExtensions).Although the guys were skeptical about a comparison session at first, the session was a real success: win-win-win for all three frameworks ;) NOS Süd finished with a Coding Dojo facilitated by @ilkerde. After that dojo (my 3rd only) I still have some mixed feelings. I was looking for learning any new design/coding practices but the only major thing I learned was the importance and complexity of selecting members for a development team. After a while it’s not fun anymore to argue about whether we do TDD or BDUF… Still it was very good experience for me, and I think for others who took part. Thank you Ilker! If Open Space is so great because of the “coffee break”-like experience, imagine the coffee breaks at Open Space! Of course the biggest part of NOS Süd (at least for me) were it’s parties and breaks when I chatted with many bright and passionate folks and it was the most inspiring and enjoyable experience of the weekend! 6/1/2010 DotNet Cologne 2010: WCF4 Live Coding with GitHubAnother great .NET community event has taken place on last Friday – DotNet Cologne 2010. Big thanks to all the attendees, speakers, sponsors and organizers for making it happen. The event was a huge success. And I even got a chance to speak there about improvements and novelties of Windows Communication Foundation 4.0. To make it more fun and educating at the same time I decided to do an experiment: use Git–a distributed version control system–in combination with live coding. I took quite a fast coding pace aimed for experienced WCF developers, showing them what’s really new about WCF4. But to make the code samples more accessible for the beginners and to make my coding “traceable” I committed each exercise to a local Git repository right during my presentation and pushed them all in the cloud to GitHub. A local Git repository makes it really easy to save your coding progress, while code hosting platform in the cloud like GitHub allows you to share and collaborate on your code with others. So now anybody can review the commits history of my live WCF4 demo and easily grasp for example what it takes to call a dynamically discovered service via a generic channel factory. I liked the experiment myself and also got some positive feedback from the audience regarding the usage of Git. On the downside I ran out of time and had to leave a couple of interesting demos aside, though not because of Git but poor time planning. Lessons learned, promise to improve next time ;) Join me on GitHub. Your feedback is always welcome! 5/9/2010 Timer RevisitedLast time I wrote some GUI code with time dependencies (like refresh data every 10 seconds), I used to extract the timer into an interface with an event and inject that dependency in the presenter/controller/view model. That way the UI logic is kept testable because I can swap the dependency with a test double which triggers the event manually. Now I think I have a more elegant solution – an Observable from the Reactive Extensions Framework. Take a look at the ViewModel: 1 public class SomeViewModel 2 { 3 public SomeViewModel(IObservable<Unit> timer) 4 { 5 timer.Subscribe(x => UpdateUI()); 6 } 7 8 private void UpdateUI() 9 { 10 //... 11 } 12 }
1 var timer = Observable 2 .Interval(TimeSpan.FromSeconds(10)) 3 .Select(x => new Unit()) 4 .ObserveOnDispatcher(); 5 6 var model = new SomeViewModel(timer);
And here is the code to put in a test: 1 var fake = new Subject<Unit>(); 2 3 var model = new SomeViewModel(fake); 4 5 fake.Publish(new Unit());
So, if think to write an interface with an event, that you want to pass somewhere as a dependency, think again. Maybe the generic IObservable<> interface will do the trick much simpler. Moreover, client code can leverage the full API of Rx provided through extension methods to IObservable<>, so that the client can for example throttle events or combine them in many different ways. Rx is very powerful. As the next step I’m thinking of abstracting a clock as IEnumerable<DateTime> instead of writing a custom IClock interface or using a global variable like MyTime.Now or much worse DateTime.Now. What do you think about time and timer dependencies? 4/4/2010 ChangeI have already written about a change I was part of last year. Being a coach after two years of product development made me realize what my true passion in software development is. It’s continuous improvement – Kaizen. While being in a product development team you have to measure your pace with the team’s pace and not to run too far ahead for too long – the team should be able to keep up. And you are bound to the technologies of a particular application type – no WPF for a web-service app etc. :( After long thoughts I finally decided to go in consulting. WPF wasn’t the main reason, of course ;) I just plan to meet different projects and different teams. This is what should bring me my Kaizen pace, at least in my beliefs. So, since April I’m part of Managing Technology team, looking forward to new projects and new experiences. And I’m on twitter now :) 12/24/2009 Mono as a lightweight .NET runtimeHow big is .NET 3.5 runtime? The full redistributable package for x86, x64 and ia64 platforms including 2.0 and 3.0 is about 200 MB. Not a single user needs to download and install it all: somebody already has 2.0 or maybe even 3.0, and nobody is going to install all the supported architectures (x86 etc.) on a single machine. So this huge download is only intended to be distributed on a CD or DVD with applications requiring .NET, when you don’t know in advance what platform you are targeting. If you do know the user’s platform in advance, you can downstrip the package down to some 20-60 MB. Which is pretty good. Anyways .NET Framework has to be installed using Windows Installer, and it’s a quite invasive way of deploying an application. Can somebody XCOPY-install .NET Framework? I suppose it to be very tricky if possible at all. And we have those copyrights and license agreements saying that Windows Installer is the only legal way to deploy .NET runtime to users. All this problems might seem illusive, since Microsoft is pushing .NET Framework through Windows Update and starting from Windows XP SP3 and Vista RTM users get at least .NET 2.0 installed. But the e-health market, my company works in, is very conservative (at least in Germany) and users are still running Windows 2000 with windows apps emulating DOS-like GUI. It is horrible! We can not rely on any Windows Updates or even a live and fast internet connection to run the .NET Framework setup bootstrapper. Moreover, our software, a web service, should be deployed as an integrated component into some third party application (almost definitely not a .NET one). And the more complex our deployment story is, the less partners would want to embed our software into their products. Are there any alternatives out there? One can turn to virtualization solutions. But instead of hardware virtualization, one can virtualize the .NET runtime. Using Xenocode Postbuild it is possible to compile a managed application into an unmanaged one with embedded fully functioning .NET runtime. The size of an app starts from 11 MB for a simple Hello World App and is from 40 MB in a real world scenario (without deleting unused .NET code, so that reflection can work properly). And this is pretty good, although not cheap. Here comes Mono There is also the Mono Project out there, which contains an open source runtime compatible with .NET CLR on binary level. It means that you can run apps compiled for .NET CLR on Mono CLR without recompilation. Mono’s cross-platform nature makes it much simpler in what it means to deploy the runtime. You just have to fulfill the requirements of the LGPL or obtain a commercial license from Novell. How it works? So I downloaded and installed the full Mono for Windows package and started to play with it. My aim was to get a minimal subset of Mono to be able to run the Mono’s XSP development web server and its test web site (\lib\xsp\test\). The result is the following structure of 45 files only 21 MB in size total:
It is still far from perfection (why ASP.NET applications need System.Windows.Forms, for example), but it is a good proof of concept. I’m only a newbie to the whole world of Mono. But now I can start a web site on a windows machine without any .NET Framework installed from a website folder just like this:
In order to make it repeatable, I made a batch script that creates this Mono-mini package out of a real Mono installation. It can be used like this:
Summary I’ve got an XCOPY-deployable .NET runtime for my ASP.NET web services with 3.5 support in under 21 MB (7.5 MB zipped) which works on my machine :) What now?
Technorati Tags: mono |
|
|||
|
|