Bubbling Events

P

Paul

Hello,

I am aware that in ASP.NET there is the concept of event bubbling. What I am
after is some advice on achieveing the same thing in a standard application.

Say I have 3 classes. View, Controller and Model.

View calls Controller and then Controller calls Model.

I would like Model to raise events which the View can handle.

What is the best practice way to achieve this? Should i just raise the event
in Model and then re-raise it in the Controller? Or is there a better way?

Thanks
Paul
 
P

Paul

sorry maybe using MVC was a bad example. Lets just say it 3 classes in a
hierarchy. The class at the bottom is the event raiser. The class at the top
must handle the events...but it can only talk to the middle class. And the
middle class can only talk to the bottom class. It's not asp.net.
 
P

Paul

hi

sorry. what im asking is what is the best practice way (if there is one) of
getting the events from the bottom to the top.

As i see it i could...

(1) have events raised at the bottom and handled in the middle and then
re-raised in the middle and handled again at the top. this seems like
duplication of effort and like re-throwing exceptions im not sure if it is
frowned upon or not.

(2) i could pass the event around from the middle to the bottom. again im
not sure if i like the idea of passing events around. im not sure if this has
impacts from a thread safety / overhead standpoint.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top