![]() It's not the strongest of the species that survives, nor the most intelligent... but those most responsive to change.- Charles Darwin |
Could it be that someone is doing their homework, and evolution theory is the topic of the next exam? |
Monday, July 30, 2007
Embracing Change?
Tuesday, July 24, 2007
Next in Line, Please!
Historically, there have been more Microsoft ways to access the Northwind database than there are rows in the Customer table.
- David Ing
(from a funny blog post against the hype of C# 3.0 and Linq/DLinq)
Monday, July 23, 2007
Protected? Sure?
Call me stupid, but I only recently realized, that the access-level 'protected' has a different meaning in Java than in C#.
Java:
Visibility of the members of Alpha:
Modifier | Alpha | Beta | AlphaSub | Gamma |
public | Y | Y | Y | Y |
protected | Y | Y | Y | N |
no modifier* | Y | Y | N | N |
private | Y | N | N | N |
(* also called package private)
C#:
Visibility of the members of Alpha:
Modifier | Alpha | Beta | AlphaSub | Gamma |
public | Y | Y | Y | Y |
protected internal | Y | Y | Y | N |
internal | Y | Y | N | N |
protected | Y | N | Y | N |
private * | Y | N | N | N |
(* private is the default access-level for members if nothing is specified)
Thursday, July 19, 2007
Reality Check
From the ASP.NET Scalability Panel (DNR 246):
Do not underestimate the value of physical reality!
- Kent Alstad (1h 08min 53sec)
Wednesday, July 18, 2007
Return of Friendship
In the good old days, friendship was a meaningful construct.
On lone evenings, I like to look back to the long gone era of C++, long before the decadence of virtual machines and the sloth of garbage collection.
Back in those days I could declare someone as a friend and this meant trust. Absolute, boundless trust. Even though this intimate relationship was not necessarily bi-directional (I was not necessarily the friend of my friends...sigh!)
I know, its hard to grasp the full meaning and consequences of friendship for the insubordinate youths of today's Java- and C#-Sharp generation (and even more for their self-indulgent Ruby- and Phyton-offspring).
For a long time I had looked at the world of today with great despair, but recently a spark of new hope has found its way into my heart: Friendship has returned with the .NET Framework 2.0 and seeks its way into the troubled lives of the young generations.
Of course today's new friendship is not the same as in the old days: The friendship between assemblies its much more coarse than the delicate friendship between classes used to be. But hey, it's a beginning, don't call me a grumpy old man!
Here we have a modern declaration of friendship:
using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Test")] namespace Friends { public class PublicFriend { internal string InternalMethod() { return "I am Internal!"; } } internal class InternalFriend { public string PublicMethod() { return "I am Internal!"; } } } |
And here we have an example of how to enjoy the pleasures of this friendship:
[TestFixture] public class Test { [Test] public void instantiate_internal_friend_should_work() { InternalFriend myFriend = new InternalFriend(); Assert.IsNotNull(myFriend); string test = myFriend.PublicMethod(); Assert.IsTrue(test.Length > 0); } [Test] public void calling_internal_method_should_work() { PublicFriend myFriend = new PublicFriend(); string test = myFriend.InternalMethod(); Assert.IsTrue(test.Length > 0); } } |
Rejoice and praise the lords high up in Redmond for the mercy they show for our blunted souls!
Thursday, July 12, 2007
Workshop: Testing Java EE Applications
Last Friday I was holding a Workshop at the 'Software Schule Schweiz' (SWS) about Testing Java EE Applications.
The slides and the example code can be downloaded here.
The workshop was part of the Course 'Enterprise Application Development mit Java EE (EADJ)'. Last semester I was attending this course myself. Testing was a topic I sorely missed, and I stated this in the feedback-survey.
Soon afterwards I met the main lecturer of the course at the BAT, and we started a discussion about how to address testing in the course and how I could get involved (@Patrick: Thanks for bringing up the topic!).
This workshop was the first result. I am looking forward to repeat the workshop next semester.
The feedback I got from the attendees was really good. For my part I had a lot of fun holding the workshop, and I learned a lot. The attendees were extremely cooperative. The result was a lot of discussions and exchange of experience and opinions.
There are some topics I did not include this time, mainly because of a lack of preparation-time. I will try to include these in the next version:
Furthermore I plan to switch to Keynote on my new MacBook for presentations. It just has more style...