|
Architect or Cobbler?
Good code starts with good design |
|
about me
links
Blogs I follow
recent posts
archives
feeds |
A temporary homeSunday, September 25, 2005# posted by James @ 1:09 PM Home at lastSaturday, September 17, 2005Anyway I'm home now, the obligatory hellos are out of the way, the kids have raided my bags looking for gifts (slim pickings this year, I can't say the geek toys have been too great), and the first beer has been opened, so it's time to kick back and reflect on PDC. Much of the the material I saw this year seemed to be very reactive from Microsoft. Developers are starting to use Ajax to deliver real innovative web applications, so MS announce the Atlas project. The WS* stack is also starting to get a real beating from RESTful web services, with Amazon taking the lead here, so WCF (Indigo) gets support for 'Plain Old XML', except it isn't really REST. Vista has great graphics capability, granted, and it looks exciting, but I can do many of the same things using Flash today, and the Expression range of design tools look like similar offerings from Adobe and Macromedia, amongst others. Then there are the changes to the underlying framework to support data bindings without having to use ADO.NET. This technology looks neat, but the languages (VB and C#) have been made really complex to keep up with this. You now have a whole new raft of relational keywords and support for lambda expressions to be able to achieve this. ORM tools have shown for years that you can add these features using a combinationof inheritance and reflection, I'm not sure the language needs to have been made so complex. Don't get me wrong, there is lots of innovation in the MS world. It's just that at the end of PDC 05, I'm left wondering where it is. to my mind this PDC was just Bill showcasing Vista, and trying to evangelise, but more importantly to turn the 10 000 or so developers in the audience into evangelists. Well, I'm sorry but it didn't take with this old Java luddite. # posted by James @ 7:18 PM A strange dayFriday, September 16, 2005I'm also pretty much a "man in the middle", this doesn't mean I sit around waiting to hijack you, but that I enjoy coding in the server sphere, and I'm really excited by technologies like remote communication and web services. So today there hasn't been a great deal of focus on the areas I enjoy, so it's been pretty slim picking for me. I did get to see SimonGuest and Kirill Gavrylyuk do a very entertaining seesion on .NET/J2EE interop, and although it was great to see that Simon gets nervous like us mere mortals, it didn't really add to the sum total of the interop story. What Simon was saying was that the J2EE vendors are getting behind WS* specs and that Indigo is already there, so if you use these specs you'll interoperate. And while I agree with that statement, I think we're some way off yet. Most of the big Java toolkits haven't built the MTOM (Message Transmission Optimasation Mechanism) bindings that will allow for interoperable transmission of attachments yet. So my advice is that interop is nearly here for complex cases, but is probably 6 months off. I also went to a talk on tips for writing Indigo applications, and I thought I wqas going to get some great design tips, instead what I got were some tips for using Indigo bindings. Stuff I need to know, but I sure wish Microsoft would give their sessions better names, as that's pretty much all you have to go on to decide which session to attend. So what have I done for the rest of the day. Well I haven't had to nurse a hangover, Miller Light is not my beer of choice, I have discovered. I have had the opportunity to do plenty of hands on labs. Now as a trainer, I can tell you writing good labs is an art form. You need clear instructions, without making a delegate feel as if they're being mollycodddled. In the main, the labs I've done today have been there or thereabouts, and I've certainly got to play with cool new technologies (for instance I wrote my first Linq app, although that wasn't what I was supposed to be doing :-)) Anyway I never thought I'd be at a PDC and see Eclipse, Java code, emacs and Perl, but it's all been out there in open view today. Now I'm off to go and bend Simon Guest's ear. # posted by James @ 2:11 AM New C# FeaturesThursday, September 15, 2005The first thing, which won't be a surprise after reading my last blog entry is that you don't need to explicitly type local variables: Using type inference the compiler can infer the types. It should come as no surprise that these implicit types must always be initialised when used. So var x would cause a compiler error. Extension methods are static methods which can be used to extend the functionality of a class without having to subclass the class, to declare and use this extension looks something like this: Lambda expressions are introduced into the language to allow you to write anonymous methods. I know many of you might not even have got to grips with writing anonymous methods yet, but it does seem like a nice way of writing a piece of inline code. A lambda expression should be familiar to the Lisp programmers among you (or Scheme, or Haskell or any of the other functional languages), it is essentially an anonymous function where values can be bound to the function arguments at run time (or compile time in some languages, I was going to ask, but bottled it) would run a query and return all those jobs that had a description "C# Debug" and priority less than 4. You can also, although I was getting lost by this time (so I know what my homework is), use the lambda expression to build expression trees. C# also includes the notion of initialisers now, so I could write a class and construct it like this: If you read my last blog you would have seen me use an anonymous class in Visual Basic and probably wondered what it was. Well C# has the same facility, I simply provide initialisers to the constructor and an anonymous class with appropriate properties will be created. There is a naming scheme for these classes but I couldn't keep up. So quite a few new features to be mulling over. It's a long time till C#3.0 is released, so the final release may look nothing like this, although that's unlikely the team appear to be quite a long way along this road, having released pre-beta implementations that actually do this stuff. My head hurts now, but only one session left, and then I can go play on some rides. # posted by James @ 12:23 AM Language Integrated Query (LINQ)Wednesday, September 14, 2005Linq is not an ORM, it is a query system for the .NET framework, (an Object Query Language if you feel more comfortable) which allows you to query any object that implements IEnumerable I think the VB would look something like this, but I couldn't swear on it: The LINQ technology also includes two packages for creating Enumerable collections that LINQ can query. DLinq connects to Databases and creates a collection based on mappings, Anders made the claim that this will replace ADO.NET. I'm not 100% sure that this will happen very quickly, and in fact I can think of some occasions where you may not want to think of your data as objects. As with the Wilson ORM mappings are declared using attributes. XLinq, on the other hand is the library that allows for accessing and querying XML data, agin the technology felt familiar to me from using JDOM, a library which treats XML elements and attributes as normal Java collections. For those of you wanting to see more you may want to visit this page I'm keeping a close eye on these technologies though, they are extremely promising. And now to go and see another talk from Anders on the new .NET 3.0 features. # posted by James @ 11:38 PM The Mid Morning BreakLast night's Birds of a FeatherI went to a fairly late BOF entitled Java vs .NET, and the first thing that surprised me was that I'm not the only Java developer here :-) The session was excellent, with people quickly agreeing that J2EE to .NET was a more appropriate comparison, although latterly it did tend to discuss Java versus C#, despite the moderator's great efforts to bring us back on track. I'm not going to go over the arguments, I think the overall concensus was that they are both great tools, and the fact that they both exist means that both products continually improve in order to try and remain competitive. The only thing I will say is that we could easily have carried on for another hour, it was that good. This morning's keynoteIn many ways, this morning's keynote left me with a happier warmer feeling, as the tools being demonstrated were very useful(or in Darrenspeak way, way cool). Windows Workflow FoundationWWF hooks directly into Vis Studio 2005, and has created a set of .NET classes which illustrate common application workflow choices. So for instance there are choice widgets, delay widgets, message widgets etc. Even better, you can create your own workflow controls and make these available in the workflow designer. I've played around with the Hand's on Labs already and it appears to be fairly stable. I suppose the question is, what about BizTalk? Well actually I don't see this type of workflow as competing with orchestration. Orchestration is all about high level business process, what processes must an order flow through for instance, while this type of application workflow is all about abstracting flow out of the application, so you don't have to have if statements inside a button event handler, for instance. Visual Studio Tools for ApplicationsVSTA is the replacement for VBA. It allows developers to interact with Windows applications using the .NET class libraries, and also looks very powerful. It apparently will co-exist with VBA, and I for one am happy to see a new tool in my armoury for customising applications. ExpressionI'm a bit of a luddite, I'm still happy with 'green screens', so GUI's with a grey button are perfectly adequate :-) However, the WPF has given developers great flexibility and power when designing interfaces. And that's the problem, designers need to be able to create these interfaces, that developers can then glue into. Microsoft showed off three products in this range, which looked very good, in order to achieve this: Acrylic - A vector based image editing suite (with raster support) Sparkle - Allows the designer to add animation and interactivity to the design,w ithout having to write code. Quartz - A CSS compliant graphical page editor, which generates aspx pages, and more importantly appeared to support round tripping. No more changing the CSS and it not being reflected in the design view. Microsoft face some pretty tough competition in this space, so it may be an interesting few months. But the bar appears to have been raised, so we'll see how companies like Adobe and Macromedia respond to this challenge. The keynote finished by giving a much more complete demo of Office 12 new features and a sweetener for us developers - access to the Office 12 Beta 1. I can't wait to try out the Sharepoint integration. # posted by James @ 6:44 PM PDC Day 1I think there were some key themes I took from the keynote. First, it's not just Longhorn that get's a rebranding. Welcome to the world of Windows Communication Foundation (Indigo) and Windows Presentation Foundation(Avalon on Vista ) and even WPF/E (Avalon on anything else, I forget what the E stood for) Another key thing that really astood out is something that Dave and I were discussing the night before conference. I was saying that there was no compelling reason to move to Indigo, in fact there may well be compelling reasons not to. The SOAP stack can be complex, the standards still aren't nailed down and the Indigo toolkits, with the best will in the world, are unhelpful (I know there's a year to release and the toolkit will probably get much better, I do think Microsoft make a fairly decent job with tools). The world out there may be passing SOAP services by, and RESTful web services are certainly getting a look in. So what do we see announced today (and demonstrated), support in Indigo for standard XML over an HTTP Channel. Unfortunately, it has the rather poorly named POXChannel (I figure the POX is for "Plain Old XML", but never asked) Also, the Atlas project is now firmly out in the open, so Microsoft are taking on board the threat of AJAX (Asynchronous Java and XML), and are creating their own framework. Just what I need, another web development framework. LINQ was previewed as well, which seems to be the replacement in many ways to ObjectSpaces. It was more than an ORM however, in that it tried to provide a uniform query language across objects, XML and databases. This also looked fairly interesting, and certainly something I'll be playing with. IE7 was also previewed here, and it looks decent enough, tabbed browsing, RSS integration, a print preview and print page function that finally works (this got the biggest applause of the keynote, nearly) Just as I was getting jaded however, Office 12 was demonstrated. there are some interesting new features in Office 12 which look to me to be a strong case for migration when it ships with Vista, but by the time we got to this I'd stopped taking notes, so you'll ahev to look at someone else's blog to see all the cool new Office features. What did strike me was the strong integartion with Sharepoint, and for our organisation, I was really excited by the integration between Powerpoint and Sharepoint, including some form of team working on presentations, which is a boon to a training company. The sessions I've atended though, have been high quality, I've picked up some useful coding tips, and I've got a glimpse into the future. So in hindsight, about a 7/10. # posted by James @ 1:12 AM Countdown to PDCSaturday, September 10, 2005As usual, the most difficult thing for me is going to be deciding between some very tempting seesions, sometimes you wish you could split yourself in two, but then I realise I'd just have to work twice as hard so I bounce back to reality. In any case the plane to LA is about to board, in a little over 12 hours of cramped time, I shall be there. Look out Malibu, here I come ... # posted by James @ 10:54 AM Factory MethodsWednesday, September 07, 2005Quite simply, instead of allowing the user to directly create objects, you provide a static Factory Method that will return instances of the required type. You must make sure that the factory method returns either an interface or an abstract type, allowing you to easily add new types in the future. This gives you a factory class something like this: The SingerFactory determines what type of Singer to return (although you could provide arguments in the factory method that the client can pass in to provide some hints), and a useful place to keep the configuration items is in the application config file, as I've done here. The GetSinger method could now look up the key and use the value to create and instantiate a specific type of Singer, although having heard me sing, you wouldn't pay for the privilege again. Clearly Elvis and James are simply implementations of the interface Singer. This approach to object construction is rather simplistic however, and although factory methods are widely used, there has to be some better way of selecting the type of object you want returned. I couldn't imagine Simon Cowell wanting to use my SingerFactory, for instance. Another issue, of course is the proliferation of concrete instances which are very similar to each other (although James is not very similar to Elvis, except possibly in circumference - and I'm not talking the young Elvis' waistline). So in some future blog , I'll examine the Abstract Factory pattern. This won't be for a while though, as next week I'm at PDC - woo hoo. Dave will be there with me, along with Thomas Lee, QA's chief technologist. Along with them I will be reporting daily on the goings on at PDC - so if you can't make it there then have a read of the blog. And if you are a blog reader, and see me at PDC, you may even convince me to buy you a beer (more likely I'll try to get Dave to buy it though). PS ADO.NET 2.0 and ASP.NET 2.0 heavily rely on factories through the use of the Provider, so I might make a short detour through the Provider # posted by James @ 2:06 PM |
|
|
|