I'm no expert in UML, I just took a course before I graduated that spent a significant amount of time on UML modeling. I understand the basics but I was working on a project the other day and just for my own curiosity, I was wondering how you would model a callback. Here is a portion of the code I was working on
class OnChangeHandler():
def my_init(self, rem, loc):
self.remotes = rem
self.locals = loc
def process_IN_CREATE(self, event):
#Do some work
def process_IN_MODIFY(self, event):
#Do some other work
class Watch():
def __init__(self):
self.wm = WatchManager()
self. notifier = AsyncNotifier(self.wm, OnChangeHandler(loc=self.locals, rem=self.remotes))
I'm using a framework obviously, so I guess my question boils down to how would you model complex relationships where you are working with black box modules and frameworks? Is it just not even worth spending time on? But if so, aren't the majority of programs built within frameworks? I found UML class models to be really helpful when we were learning, but now I'm just confused.