elfs: (Default)
[personal profile] elfs
The article is long and geeky, so I won't republish all of it here, but if you want to read about my latest lightbulb moment, you can read Django Signals Enable Aspect-Oriented Programming at the software development website:
An activity stream, a specialized form of logging, is orthagonal to your business logic, but critical to many social applications: this is known as a cross-cutting concern. Having to touch all of your Django applications in order to get logging becomes known as tangling.

Django provides an easier way of monitoring its own internal activity, called signals. A "Signal" is a specialized object that can publish when a certain event has occurred, and then other systems can subscribe to receive the signal when the event occurs. Classic examples of this are logging, and my activity stream.
The article discusses how to "glue" two Django applications together into a deployable web product without having to write specific code in either one that enables the two to intercommunicate meaningfully. The logging case is especially interesting because the the front end is "one publisher, many subscribers" (the database is emitting the "saved something" signal, which then must be associated with the many "somethings" saved and about which log entries are generated), but the tail end is "many publishers, one subscriber" (all the different apps sending signals to the logging). Melding these together in a single separate "routing application" helps disentangle your objects from having to know too much about each other, making this a classic example of aspect-oriented programming.

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 1st, 2026 09:23 pm
Powered by Dreamwidth Studios