The Artima Developer Community
Sponsored Link

Agile Buzz Forum
OT2004 : Generic Mechanisms in Software Engingeering

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Joe Walnes

Posts: 151
Nickname: jwalnes1
Registered: Aug, 2003

Joe Walnes, "The Developers' Coach" from ThoughtWorks
OT2004 : Generic Mechanisms in Software Engingeering Posted: Mar 31, 2004 2:19 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Joe Walnes.
Original Post: OT2004 : Generic Mechanisms in Software Engingeering
Feed Title: Joe's New Jelly
Feed URL: http://joe.truemesh.com/blog/index.rdf
Feed Description: The musings of a ThoughtWorker obsessed with Agile, XP, maintainability, Java, .NET, Ruby and OpenSource. Mmm'kay?
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Joe Walnes
Latest Posts From Joe's New Jelly

Advertisement

This workshop, hosted by Simon Davies, and chums from Microsoft (with a bit of Bruce Anderson), was a thinking excercise about the pros and cons of some of the language features of C# (and conveniently also Java) including generic types, attributes and dynamic code generation.

We were given some sample scenarios to which we had to contrast the approaches of using these features in isolation and combined together, taking into account ease of development, runtime performance, flexibility, maintainability and simplicity:
* Creating a strongly typed list.
* Serializing objects to XML (a subject I'm familiar with).
* CRUD persistence of domain objects to a database.

This was quite thought provoking. While it was very easy to see the advantages of using generics to implement a strongly typed list, experimenting with all the different approaches was a fun exercise. Code generation may be less simple but offers better runtime performance.

It was fun brainstorming ideas with developers from different backgrounds and seeing which approaches appealed to them.

I was also shown the anonymous delegate feature in the next version of C#. Mmmm closures...

// usage
int totalAge = 0;
peopleFinder.All(delegate(Person person) {
  totalAge += person.Age;
});

// implementation
class PersonFinder {
  
  public delegate PersonDelegate(Person person);
  
  public void All(PersonDelegate delegate) {
    some magic iteration code {
      Person person = ...;
      delegate(person);
    }
  }

}

Now for a staticly typed language, that's a lot cleaner than I was expecting.

This is something I'm really excited about as it's the style of development I use all the time in Java, without all the syntactic cruft of anonymous inner classes. And I'm sure it'll appeal to all the Ruby/Smalltalkers out there.

Something else I learned is that (unlike Java 1.5), generic definitions are available at runtime.

Plenty more info in the C# 2.0 specification.

Read: OT2004 : Generic Mechanisms in Software Engingeering

Topic: StS 2004 - Jeff Eastman on Open Augment Previous Topic   Next Topic Topic: StS News from STIC

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use