Professional Documents
Culture Documents
Claude+ - Poe Events
Claude+ - Poe Events
explanation
UI (User Interface) and Logic separation is an important software
engineering principle. It means separating the user interface (UI)
code from the business logic code in an application.
Events:
Delegates:
Observer Pattern:
Co
python
py
def on_button_clicked():
print("Button clicked!")
button = gui.Button("Click me!")
button.add_click_listener(on_button_clicked) # Register call
Co
python
py
def on_data_received():
print("Data received!")
sock = socket.socket()
sock.bind(("localhost", 8000))
sock.listen()
sock.add_read_listener(on_data_received) # Register callb
Co
vbnet
py
Contracts & Abstractons
┌────────────┐
│ Event (Interface)
│ - eventType:String
│ - timestamp:Date
└────────────┘
Publish
Register
┌────────────┐
│ Subscriber │
│ - eventType:String
Notify
│ - notify(event:Event)
└────────────┘
┌───
┌────────────┐ │ Pu
│ Button │ │ - p
│ - addClickListener(│
│ subscriber:Subscriber) │
└────────────┘