List Info

Thread: Anticipating future backwards incompatibility




Anticipating future backwards incompatibility
user name
2007-08-30 08:09:12
Just a thought I had when playing around with the 2.19
series.  It's
had a good scrubbing in the refactoring effort, but e.g.
extensions
written for the 2.18 series no longer work.

It might be possible to write an adapter class to convert a
2.18 style
Handler to a 2.20 style Module (e.g. wrap or dynamically
mix-in or
some other Python magic) an old-style Handler to add a
get_actions()
method to a 2.18 Match object, for example.  For that to be
even
feasible, we would have to be able to tell the old and new
style
apart.

Fortunately, we can distinguish between 2.18 (and 2.16 and
2.14) style
Handlers and 2.20 style Modules because the former live in
~/.gnome2/deskbar-applet/handlers and the latter in
~/.gnome2/deskbar-applet/modules.  Which is all well and
good.  But
suppose that we do another refactoring in 2.26 that breaks
API
compatibility again.  We might not find a suitable name that
isn't
"Handler" or "Module".

Thus, it might be better to rename
~/.gnome2/deskbar-applet/modules to
~/.gnome2/deskbar-applet/modules-2.20-compatible

Similarly, we might want to rename history_new.pickle to
history-2.20-compatible.pickle, or in general, stamp a
version on
anything persistent, in anticipation of future backwards
incompatibility.

Also, we might require Module writers to implement an
is_compatible_with(deskbar_version) method or maybe a
get_module_for_deskbar_version(deskbar_version_string)
method.  For
example, [1] presents a Tracker Handler/Module that attempts
to be
both 2.14 and 2.20 compatible.  I'm not sure if it's best if
the core
deskbar code does this sort of conditional loading, or
whether the
extension writers do this.  It would be nice if, supposing
we broke
the Module API in 2.32, that my old 2.20 Module still worked
with
Deskbar 2.32 since Deskbar 2.32 first asked for a
2.32-compatible
version and, failing that, adapted a 2.20-compatible
version.

Something to think about, perhaps, before we actually mark
our
upcoming 2.19 / 2.20 Modules as stable.


[1] http://mail.gnome.org/archives/tracker-list
/2007-August/msg00118.html
_______________________________________________
deskbar-applet-list mailing list
deskbar-applet-listgnome.org
http://mail.gnome.org/mailman/listinfo/deskbar-applet-
list

Re: Anticipating future backwards incompatibility
country flaguser name
Germany
2007-08-30 11:31:08
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nigel Tao schrieb:
> Just a thought I had when playing around with the 2.19
series.  It's
> had a good scrubbing in the refactoring effort, but
e.g. extensions
> written for the 2.18 series no longer work.
> 
> It might be possible to write an adapter class to
convert a 2.18 style
> Handler to a 2.20 style Module (e.g. wrap or
dynamically mix-in or
> some other Python magic) an old-style Handler to add a
get_actions()
> method to a 2.18 Match object, for example.  For that
to be even
> feasible, we would have to be able to tell the old and
new style
> apart.
> 
The only possibility could be that old style handlers return
DummyMatches and the old-style Match gets wrapped by a
Action. It's just
a quick thought. However, I think it won't be easy to get
old-style
handlers working properly in 2.20.

> Fortunately, we can distinguish between 2.18 (and 2.16
and 2.14) style
> Handlers and 2.20 style Modules because the former live
in
> ~/.gnome2/deskbar-applet/handlers and the latter in
> ~/.gnome2/deskbar-applet/modules.  Which is all well
and good.  But
> suppose that we do another refactoring in 2.26 that
breaks API
> compatibility again.  We might not find a suitable name
that isn't
> "Handler" or "Module".
> 
> Thus, it might be better to rename
~/.gnome2/deskbar-applet/modules to
> ~/.gnome2/deskbar-applet/modules-2.20-compatible
> 
> Similarly, we might want to rename history_new.pickle
to
> history-2.20-compatible.pickle, or in general, stamp a
version on
> anything persistent, in anticipation of future
backwards
> incompatibility.
> 
You're absolutely right. If nobody has an objection I'll put
it in the
next release on Monday.

> Also, we might require Module writers to implement an
> is_compatible_with(deskbar_version) method or maybe a
> get_module_for_deskbar_version(deskbar_version_string)
method.  For
> example, [1] presents a Tracker Handler/Module that
attempts to be
> both 2.14 and 2.20 compatible.  I'm not sure if it's
best if the core
> deskbar code does this sort of conditional loading, or
whether the
> extension writers do this.  It would be nice if,
supposing we broke
> the Module API in 2.32, that my old 2.20 Module still
worked with
> Deskbar 2.32 since Deskbar 2.32 first asked for a
2.32-compatible
> version and, failing that, adapted a 2.20-compatible
version.
> 
That's the smaller problem. If you can write an adapter for
old-style
classes this step won't take much.

- --
Greetings,
Sebastian Pölsterl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFG1vDM1ygZeJ3lLIcRAqDWAJoDCYZgSnz3Z0pgIQwl2LcZX6yd+gCg
qJM2
2yqxZ07OBNfxOgc57udGmM4=
=tP+v
-----END PGP SIGNATURE-----
_______________________________________________
deskbar-applet-list mailing list
deskbar-applet-listgnome.org
http://mail.gnome.org/mailman/listinfo/deskbar-applet-
list
Re: Anticipating future backwards incompatibility
country flaguser name
Germany
2007-09-03 05:21:54
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nigel Tao schrieb:
> Fortunately, we can distinguish between 2.18 (and 2.16
and 2.14) style
> Handlers and 2.20 style Modules because the former live
in
> ~/.gnome2/deskbar-applet/handlers and the latter in
> ~/.gnome2/deskbar-applet/modules.  Which is all well
and good.  But
> suppose that we do another refactoring in 2.26 that
breaks API
> compatibility again.  We might not find a suitable name
that isn't
> "Handler" or "Module".
> 
Changed modules folder to modules-2.20-compatible

> Thus, it might be better to rename
~/.gnome2/deskbar-applet/modules to
> ~/.gnome2/deskbar-applet/modules-2.20-compatible
> 
> Similarly, we might want to rename history_new.pickle
to
> history-2.20-compatible.pickle, or in general, stamp a
version on
> anything persistent, in anticipation of future
backwards
> incompatibility.
> 
Changed history file to history-2.20-compatible

- --
Greetings,
Sebastian Pölsterl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFG2+BC1ygZeJ3lLIcRAoBBAKCQZ/FQtgQJCmzZSoe6diNZqigt6QCd
ENQF
7XYdrKSfCKJ/dGZNmcTEMH8=
=fHgk
-----END PGP SIGNATURE-----
_______________________________________________
deskbar-applet-list mailing list
deskbar-applet-listgnome.org
http://mail.gnome.org/mailman/listinfo/deskbar-applet-
list

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )