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.
The definition of framework is a support structure or system that holds parts together, has something stretched over it or acts as the main structure. An example of a framework is four posts supporting a deck cover. An example of a framework is an outline created before writing an essay.
In general, a framework is a real or conceptual structure intended to serve as a support or guide for the building of something that expands the structure into something useful.
The writing framework prompts you to think about the opportunities you're providing for students to strengthen their writing in different curriculum contexts. The framework's illustrations suggest ways you can provide opportunities for students to write for different purposes in different contexts.
These guidelines are excerpted from the book Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries, 2nd Edition, by Krzysztof Cwalina and Brad Abrams. Provides guidelines for naming assemblies, namespaces, types, and members in class libraries.
The second step in creating a good framework is to develop a way to represent the list visually. While a talented designer can add tremendous value to communication power of the framework, there are a number of simple ways to organize a list.
Describe the intended uses of your framework or model of change: To convey the purpose and direction of your initiative or effort (i.e., the outcomes sought and how you will get there) To show how multiple factors interact to influence the problem or goal. To identify actions and interventions more likely to lead to the desired result.
Brad Abrams' Framework Design Guidelines book is all about this. Might be worth a look.
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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With