Friday, June 05, 2009

The concept of test beds or velcros for software modules...

Last week I attended a conference by Mario Cardinal at MSN Canada. The conference was part of the Toronto Architecture User Group.

The presentation had quite a few valid points along with the concept of "velcro" or test bed for modules. Test beds are a very familiar concept in electronics. In order to test hard drives or dvd drives, the manufacturer create test beds as opposed to test the parts in a computer. The same line of reasoning applies to software.

Here's a Tech Ed 2009 presentation by Mario Cardinal.
Download Video

I look forward to see the code from this presentation at CodePlex and see what Mario Cardinal will blog after the Alt.NET conference in Vancouver, whether the same approach can be achieved with mocking frameworks.


video


Today (June 15th) I found the code for the Velcro project at codeplex.com. Hope this helps you evaluating this concept: http://velcro.codeplex.com/


Happy coding!

Labels: ,

Being tech support for the fam...

I like helping my family whenever I can. Two weekends ago I set up the wireless network at my aunt's and last weekend my dad had a problem with a software he installed.
He needed the Vademecum application to do some research on prescription drugs (dad is Endocrinologist and draws comics on his free time)
The Vademecum application is a Java based desktop application and for some reason, after Dad installed it, it didn't work. Dad's desktop has Windows Vista. We also had another problem, Dad is based in Spain while I'm in Toronto.

I tried back and forth via email to see what was going on, but explaining over email can be exhausting...

Dad ended up sending me this :-p out of his frustration finding the Windows Explorer.



I finally came across the TeamViewer application. This app is free, not like GoToMyPC which costs about 29.99 a month, and allows you to share the desktop if both parties have the TeamViewer client...

I hope that helps you too in case you're being tech support of the fam :)

Have a great weekend!!!

Labels:

Monday, May 25, 2009

Java vs. C# access modifiers looked at by a C# programmer

I'm looking into the SCJP 6 as I don't have hands on experience on Java projects (only academic apps).
I had bookmarked long time ago a great C# vs. Java comparison Dave Obasanjo made:
A COMPARISON OF MICROSOFT'S C# PROGRAMMING LANGUAGE TO SUN MICROSYSTEMS' JAVA PROGRAMMING LANGUAGE

I noticed tonight that the member's access modifiers could use some tuning and show:

C# access modifier


Java access modifier

private


private

public


public

internal


Default (package-private)

protected


N/A

internal protected


protected


In Java, a protected member can only be accessed through classes on the same package and through subclasses whether they are on the same package or not.
The protected modifier specifies that the member can only be accessed within its own package (as with package-private or default) and, in addition, by a subclass of its class in another package. Package + Kids access.

The default access modifier in Java happens when a class member has no modifier (the default is also known as package-private). This means the member is only accessible by a class defined within the package.



Labels: , ,

Thursday, May 21, 2009

Adding an empty item to an IList collection at runtime.

How can I add a new empty item to a datasource (BindingSource) if the collection that it contains has objects of unknown type at design time:

if (dataSource.GetType() == typeof(BindingSource))
{
IEnumerator en = dataSource.GetEnumerator();
en.MoveNext();
Type t = en.Current.GetType();

object o = System.Activator.CreateInstance(t, false);

dataSource.Add(o);
}


where dataSource is of type IList.

This was a request to add an empty line to a windows forms combobox and to a listbox.

BindingSource can be bound to any of the following:

  • Object
  • System.Type
  • IEnumerable
  • ICollection
  • IList
  • IListSource
  • IBindingList
  • IBindingListView

Labels: