DWX 2016 – day 2

Halftime. On the second day of the conference I concentrated on .NET development.

The day started for me with Carsten König who gave an introduction to F# – Funktionale Programmierung mit F#. It was a good talk although only few things were really informative for me. One of my highlights so far followed: akka.net – Einführung in das Actor Model mit .NET held by Ralph Waldenmaier. He gave a very good overview and background information on that topic. I am surely going to try out the actor model in an eligible project! Normally, databases are not one of my favourite topics. But Constantin ‘Kostja’ Klein told us about Database Lifecycle Management. I found his information very useful, for they perfectly go with our actions taken to improve the lifecycle management of our software. He showed me how we can add the database aspects to that process.

In the afternoon, there were two DevSessions. David Tielke talked about .NET Core. It comprised great background information about the .NET Framework as well as about the new .NET Core. David explained very well what Microsoft’s strategy change means to us as developers. The last session was WPF Troubleshooting in Visual Studio 2015. Manuel Meyer presented very useful debugging and analysis tools that are free of charge and that help to find issues in .NET applications. Some of them are even part of the Visual Studio. In particular, Manuel concentrated on WPF applications. Very exciting and informative talk, too!

Now, I’m preparing my schedule for tomorrow.

The dotnet Cologne 2012

Wow, wow, wow. The 4th dotnet Cologne was a great event – once again! It was held at the KOMED for the second time. It is a location quite good to reach by car or public transport. 350 people met there to get information and ideas from speakers who are developers themselves. This year, a great number of the sessions dealt with the new Microsoft technologies and products such as Windows 8, WinRT, Visual Studio 2012, and SQL Server 2012. The other session topics were a mixture of agility, software technology, etc., as usual. The conference was organised in five tracks plus one additional Microsoft track. The latter comprised of sessions held by Microsoft Evangelists. Bad thing, you were spoilt for choice…

It was nice to see that JetBrains was present with a booth and two talks (on their products ReSharper and YouTrack). It was for the first time, so I went to their booth and had an interesting conversation. Anyway, talking to other participants and exhibitors is as much important as the conference sessions.

My highlight session was Rainer Stropek talking about WinRT! It was a great technical deep dive. Johannes Hofmeister shared his thoughts about Empathic Code (i.e. how code should look like with respect to readability) with us which urged me to nod the whole time. Besides that, I was interested in CQRS, some C# goodies, Windows 8 for .NET developers, and in what is new in Visual Studio 2012. Again, it was hard to pick the best sessions of that broad offering.

PS: The next dotnet Cologne is on 3 May 2013!

Guia: A new tool for automated UI testing

I have started to play around with UI Automation in order to write automated UI tests. There is a lot to do for a setup of such tests. So I am wondering if there is already a framework for this purpose. After asking the internet a bit I found Guia on Codeplex. It seems to be the right tool for us. The key features from my point of view are:

  • It works with WPF and WinForms.
  • No compiled application is needed, windows and user controls can be tested stand-alone.
  • NUnit is supported.

The project is on a very, very early stage. So I keep an eye on it for it really seems to be a useful thing for us.

Update (29 July 2011):
Sadly, the project does not make any progress at all. We have meanwhile implemented our own framework which of course fits our needs perfectly.

The dotnet Cologne 2010

What an event! Round about 300 people met at the Holiday Inn – Am Stadtwald, Cologne. And I am sure, none of them regrets his participance.

Some of the sponsors were present with exhibition stands. For me, that was informative and useful; e.g. I took home some information about a WPF control collection which could help us to solve a problem we a currently facing in my company.

I really like these community conferences. The information given there are absolutely useful for the daily work for the speakers take their topics “from life”. Additionally, it is nice to share experiences with other participants.

dotnetCologne2010The dotnet Cologne this year was held on the occasion of the launch of Visual Studio 2010 and the .NET framework 4. So, the talks, which were organised in altogether 30 sessions and 4 tracks, more or less dealt with these two aspects. That was a quite condensed programme. Even the lunch break was used for sessions! I was this time mostly interested in parallel programming, code contracts, and some goodies of the new .NET framework.

As last year, the sessions were great due to the high expertise of the speakers! The whole conference gave you the feeling of bringing you to the technological state of the art.

What was the benefit at the end of the day? First contact to new technologies or a deeper insight into it, new programming techniques, hints for your daily work – just to name a few.

Of course, there was a raffle at the end of the conference. And you may guess right that I was one of the numerous winners – this time, it was a book.

Not only from my point of view, the conference was a great success. Thanks to the organisation team – absolutely well done (again)!

The dotnet Cologne 2009

Today, I attended the dotnet Cologne 2009. It was a one-day community conference (in German) on WPF and Silverlight.

About 180 people gathered at the Microsoft building in Cologne. They were presented a very good programme. The speakers were great, the topics of the talks were great, too. The talks were arranged on two tracks most of the time.

For me, it was a quite valuable event. I gained a lot of practical insights into WPF and Silverlight. In particular, the talk on the data binding mechanism in WPF attracted my special interest. As usual, the discussions with the participants during the breaks were interesting as well as inspiring.

In addition, which made the day valuable for me in terms of money or development tools, I won a ComponentOne Studio Enterprise licence from the closing raffle. 🙂

Thanks to the organisers and I’m looking forward to the dotnet Cologne next year!

Nice tool: NHibernate Profiler

A few weeks ago, we started to use a new tool by Ayende: The NHibernate Profiler (currently beta). It is a real-time debugger to debug and improve the usage of NHibernate in our modules.

The NHibernate Profiler provides a lot of valuable (technical and statistical) data on the current activity:

  • SQL statements per session with additional information: Details, stack trace, and alerts. Alerts are some warnings which Ayende explains on his website.
  • A session usage report: Number of entities loaded, entities loaded, duration, etc.
  • A session analysis, e.g. View by Method which displays all SQL statements generated by a particular method of a module.
  • Statistics not only on the sessions, but also on the session factory.

We have used it several times to see, what our modules using NHibernate internally do. In particular, the alert information have been extremely valuable for us.

Obviously, there are still some minor bugs in the beta version of the tool. For example, we get a Use of implicit transactions is discouraged alert although we only have explicit transactions.

Usage

In order to debug an application, the client for monitoring the activity has to be started. This client provides all the information explained above.

The best way to make your application communicate with the client is to use log4net, for the application (and the solution/project) does not need to be changed in any way in this case (provided that you already use log4net in your application). Just add an appender in the log4net.config file and make the required loggers use that appender.

Example:

<appender name="NHibernate.Profiler" type="HibernatingRhinos.NHibernate.Profiler.Appender.NHibernateProfilerAppender, HibernatingRhinos.NHibernate.Profiler.Appender" >
  <sink value="tcp://localhost:22897/NHibernateAppenderLoggingSink" />
</appender>
 
<logger name="NHibernate.Transaction.AdoTransaction">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.Loader.Loader">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.SQL">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.Impl.SessionImpl">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>
<logger name="NHibernate.Persister.Entity.AbstractEntityPersister">
  <level value="DEBUG"/>
  <appender-ref ref="NHibernate.Profiler"/>
</logger>

As this example shows, the profiler appender class has to be referenced and a TCP sink for the communication with the client has to be declared. The defined loggers redirect the required information to the profiler. Finally, the DLL containing the profiler appender class has to be stored in the application directory. That’s all. When running the application, the NHibernate activities are monitored by the client.

You can (and due to the licence, you probably must) ship your application without the profiler appender class DLL. There is no need to modify the log4net.config file, though. The profiler appender does not have to be removed. log4net just complains (within its log file), that the particular appender could not be instantiated (because it was not found). If you do not want that message in the log file, you have to ship your application with a log4net.config which does not contain the profiler appender.

Another way to use the profiler is to reference the HibernatingRhinos.NHibernate.Profiler.Appender.dll and make the following call within the application startup:

HibernatingRhinos.NHibernate.Profiler.Appender.NHibernateProfiler.Initialize();

But as this means a change of the application code and requires a reference within the project, I do prefer the first kind of usage. Additionally, the application cannot be shipped when modified in this way. (Remember, you may not ship the profiler appender class DLL with your application.)