<p>I'm faced with writing a framework to simplify working with a large and complex object library (<a href="http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/ao_start.htm" rel="noreferrer">ArcObjects</a>). 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?</p>

<p>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 <a href="http://code.google.com/p/nettopologysuite/" rel="noreferrer" title="NetTopologySuite">NetTopologySuite</a> and I see so many good approaches, but honestly I'm at a loss where to start.</p>

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

[{'answer_id': 29411, 'author': 'Matt Hamilton', 'author_id': 615, 'author_profile': 'https://Stackoverflow.com/users/615', 'pm_score': 4, 'selected': True, 'text': '<p>Brad Abrams\' <a href="https://rads.stackoverflow.com/amzn/click/com/0321246756" rel="noreferrer" rel="nofollow noreferrer">Framework Design Guidelines</a> book is all about this. Might be worth a look.</p>\n'}, {'answer_id': 29419, 'author': 'Jason Baker', 'author_id': 2147, 'author_profile': 'https://Stackoverflow.com/users/2147', 'pm_score': 1, 'selected': False, 'text': "<p>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.</p>\n"}, {'answer_id': 30479, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 2, 'selected': False, 'text': '<p>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?</p>\n'}, {'answer_id': 197152, 'author': 'Samuel Kim', 'author_id': 437435, 'author_profile': 'https://Stackoverflow.com/users/437435', 'pm_score': 1, 'selected': False, 'text': '<p>Writing code for framework is absolutely very different from writing application code.</p>\n\n<p>I have always consulted (and have others consult) the <a href="http://msdn.microsoft.com/en-us/library/czefa0ke.aspx" rel="nofollow noreferrer">Design Guidelines for Class Library Developers</a> when writing framework level code.</p>\n'}]
['https://Stackoverflow.com/questions/29406', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3074/']