Event framework

  • Thread starter Thread starter veziak
  • Start date Start date
V

veziak

Dear colleagues, we have encountered some problems.
there are some types of events in our system: business objects events,
events that fire on time, on some conditions, and on user input.
so we need some framework or library which includes persistent events
and scheduling
any ideas are welcome.
thanks in advance.
 
Hi,
I am not much clear about your intension by "persistent events and scheduling" but the event mechanizm in Microsoft.Net is very good. I have given you sample which shows how to create it and how to use it.

This is a Sample according to publisher-subscriber scenario in Observer design pattern which will give you the idea of creating and using the custom delegate - which is the same concept .Net for Function pointer
On publisher side:
Delegate:
public void delegate MyDelegate(MyType sender, MyParamCollection params);

Event in MyType:
public event MyDelegate MyEvent;

Define some method for raising event like,
private void OnMyEvent() {
MyParamCollection coll = new MyParamCollection();
:
:
if(MyEvent !=null) {
MyEvent(this, coll);
}
}
and call this method at some point where you want to raise the specific event,

On subscriber side:
objMyType.MyEvent += new MyDelegate(MyEventHandlerMethod);
private void MyEventHandlerMethod(MyType sender, MyParamCollection params) {
do something.....
}

If MyType is the class from where you want to raise the event then you can call OnMyEvent method from some point like user input, or at some condition satisfiying point etc in your business object [here MyType is that class] and that way you can achieve the effect you want.

HTH,
 
If I understand your question properly, what you're after is a business
integration tool.

Microsoft's offering is BizTalk, but there are many others out there,
including Bea's WebLogic Integrator.

All of these things are terribly expensive, though. You need a fairly
large enterprise to make it worth buying them, learning them,
developing with them, deploying the results, maintenance, etc.

So, if you're working for a very large company, look at one of these
tools. If you have a smaller problem to solve, look at how these tools
work and "roll" a simpler version of your own.
 

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

Back
Top