Re: using axiom.dependency for powerups in queries
Tristan Seligmann <[email protected]> Tue, 11 Mar 2008 17:22:25 +0200
| Newsgroups | gmane.comp.python.quotient.dev |
|---|---|
| Message-ID | <[email protected]> |
--===============0114018587== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline --17pEHd4RhPHOinZp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * [email protected] <[email protected]> [2008-03-11 14:21:29 -0000]: > On 12:46 pm, [email protected] wrote: >> I think the main uses of powerups are where the powerup interface is =20 >> the >> primary concern; either for adaptation of an item, or because you have >> multiple items of different types, but providing the same interface, =20 >> and >> you want to treat them as a group. > > This is worth emphasizing. Powerups are a type of polymorphism. You =20 > pay a price for using them; they make your data model more difficult to = =20 > optimize, and bind it more tightly to your code. This can be extremely = =20 > powerful and simple, even graceful, when you need it, but can introduce = =20 > a lot of unnecessary complexity when you don't. > > A good rule when you're trying to decide whether to make something a =20 > powerup is, "Is this powerup a point of integration with another =20 > system?" If the answer to this question is "no" then you should almost = =20 > certainly be using something else. For example, cred =20 > (axiomatic.userbase) integrates with arbitrary other systems by using =20 > powerups. Mantissa loads external plugins for things like the Organizer = =20 > using powerups. > > In other words, if you *can* use regular references and queries to =20 > implement what you want, then you probably should. Powerups are for =20 > when you need more. Someone should really put this in a document somewhere close to the Axiom source code; over time, I've figured this sort of conceptual architectural stuff out through osmosis, but I'm not very good at putting it into words, and it's the kind of thing that's really useful when you're starting out trying to learn Axiom / etc. As a data point, I might add that in my whole application (20k SLOC or so), I only have one real powerup interface of my own, although I do install powerups for various Mantissa interfaces, and I have a handful of other "utility" powerup interfaces that aren't used much, and maybe shouldn't be powerups in any case. (Hmm, actually, I'm writing code right now that will introduce a second powerup interface...) --=20 mithrandi, i Ainil en-Balandor, a faer Ambar --17pEHd4RhPHOinZp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (GNU/Linux) iEYEARECAAYFAkfWo7EACgkQpNuXDQIV94rN8wCeP2Un+G6wwUgsG3biDn0kJNkP lJ4AnisigyHQgP7RQ9Q76AhCbx62Qhuh =A8mx -----END PGP SIGNATURE----- --17pEHd4RhPHOinZp-- --===============0114018587== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline