i am currenty develop an app in seaside, and am wondering about best practices when using external packages. in my case, i am using a copy of TF-Login that i updated to work in pharo 2.
The main class in that package is RegisteredUser. as is true in most cases, i will be tweaking this object a great deal. this package also contains a great deal of renderers that will be tweaked.
so, my question is: how should i go about this? should i take RegisteredUser and sublcass it? this might requried me to change other code in the package? should i subclass the renders and override their methods?
should i just go ahead and edit the TF-Login package directly? my initial thought was to edit the package direclty, but i am not sure what would happen if the package is externally updated.
thoughts? ideas? ----
peace, sergio photographer, journalist, visionary #BitMessage BM-2D8VWUJSS41RFKh1ec83preVabHrnniExa http://www.ThoseOptimizeGuys.com http://www.CodingForHire.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 |
Administrator
|
I've found the easiest and most flexible approach is two-fold: - Refactor the underlying library with the hooks and abstractions you need - And then, subclass If you just override and monkey-patch, I feel you are more vulnerable to the library changing underneath you, as well is potentially making your code harder to understand. If you can make the library designed to use it the way you want, you will reduce duplication and the chance of someone else coming in and doing it in an incompatible way, as well as give the library maintainers an idea of what you're doing, so they may consider that in making non-backward-compatible changes. Of course, that's ideal and requires library maintainers open to accepting such changes, but in practice I've found this to be true (with Pharo, Magritte, BabyMock…)
Cheers,
Sean |
i think you're right.. i just need to sit down and walk myself through it with this codebase.. since i am the maintainer of the codebase in question (although i did not write it), i really want to address this issue correctly, and not cut any corners.. thanks! On Tue, Feb 11, 2014 at 11:20 AM, Sean P. DeNigris <[hidden email]> wrote: sergio_101 wrote ----
peace, sergio photographer, journalist, visionary #BitMessage BM-2D8VWUJSS41RFKh1ec83preVabHrnniExa http://www.ThoseOptimizeGuys.com http://www.CodingForHire.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 |
Free forum by Nabble | Edit this page |