|« Exciting times...||Testing b2evolution v4... »|
About b2evo, coupling and reusability
Back in 2006, I wrote this little piece about the internal design of classes in b2evolution & evoCore... This is still pretty much relevant. So here it is again... ;)
There is a whole (almost) product called b2evolution. It's like a car. Let's say a car for driving in the city.
Inside of b2evo, there is a framework called evoCore. It's like an engine. One specific engine design can be used inside of different cars. But not in ANY car. Using a compact car engine in an SUV won't work well. Using a tank engine in an SUV won't for well either. For different reasons. Designing a different engine by extending the design of a previous one MAY work though.
Inside of evoCore there are Classes. It's like screws in an engine. A particular screw can be used for many different things, including different motors and including things that have nothing to do with a motor. Still, there are thousands of different screw designs. They all do the exact same thing. Think about it! They all have the exact same purpose! Yet they do it with a thousand different details that have their importance. And no single screw can do it all!! In the 21st century, no single country, no single company, no single engineer has managed to standardize on ONE SINGLE SCREW DESIGN. (Though IKEA has done an incredible optimization here, I must admit. They did not succeed anyway. And the more they standardize, the more they produce crappy designs. My opinion here ;)
The point is: the highest priority is the coherence of the b2evolution product.
When possible we also try to maintain evoCore as a reusable framework that *may* be apprioriate for resuse in *some* other web applications. But this is *not* the highest priority.
Finally, like the screws, the Classes cannot just be taken out and just reused anywhere else as they are. Trying to do achieve that goal is impossible.
Classes are just blueprints. It is very rare you can reuse them as they are in a different place. They just provide a basis to start with. When you think about it, about any class you ever imported into anything, I bet after sometime you always modified it in some way. We like to call that "improvement". But what it really is is "customization"! We customize the classes for our projects.
And in b2evo, the classes should be customized for b2evo, not for something else.