tags:

views:

819

answers:

5

I'm faced with writing a framework to simplify working with a large and complex object library (ArcObjects). What guidelines would you suggest for creating a framework of this kind? Are static methods preferred? How do you handle things like logging? How do you future proof your framework code from changes that a vendor might introduce?

I think of all of the various wrappers and helpers I've seen for NHibernate, log4net, and code I've read from projects like NLog and NetTopologySuite and I see so many good approaches, but honestly I'm at a loss where to start.

BTW - I'm working in C# 3.5 but it's more about recommended approach rather than language.

+3  A: 

Brad Abrams' Framework Design Guidelines book is all about this. Might be worth a look.

Matt Hamilton
+1  A: 

I think that you're consistent is more important than what conventions you go with. As far as future-proofing yourself, that's a matter of the code that you're making a framework for. It's a lot easier to build on a brick house than a sand one.

Jason Baker
A: 

Thanks to both of you for good input. Matt - looks like I'll need to add that book to my stack of Head First Design Patterns, Code Complete, Programming WCF Services.

Dylan
+1  A: 

Try to write code to be more flexible. For example, if you have a method that accepts an array as a parameter, would you be able to accept an IEnumerable or IList instead?

Joel Coehoorn
A: 

Writing code for framework is absolutely very different from writing application code.

I have always consulted (and have others consult) the Design Guidelines for Class Library Developers when writing framework level code.

Samuel Kim