Jump to content

Recommended Posts

Posted

I am studying about components of a system.

Activity-:

It is What entities do to cause changes is activity. It is represented by time period of a specified length.

Event-:

Event is defined as an instantaneous occurrence that might change state of the system. Endogenous events occurs within the system and exogenous events occurs outside the system.

eg-: making a deposit is an activity, arrival of customer is an exogenous event and completion of service of a customer is an endogenous event.

I don't see any difference between them. making deposits can also be an event as it'll change the state of the system. i.e money in bank account.

The one difference that can be taken from these definitions is "instantaneous" vs "time period' but the examples don't deliver anything about it.

Below is the figure from a slide available online.


chMzYhlTlQxQnffh5UfK6qQZTl10HyYnUBBh0j4PiyTeF7A7_-qi1qxsr9on4Rvp6iUiMkz_haHmoPJUdVeybaWkhtwhWsGBFGrxDjiXqCW9mEguaVfdXMs259fd1Y7ziXJU_GMA4ydvMOxJ2e_kM4I

Posted

Looking at your examples concerning ‘Components Of A System’, my take’s that an activity triggers what underlies an event; a kind of Butterfly Effect, if I may.

Posted (edited)
Quote

What is the difference between activity and event in "simulation"?

Is this a computer science question?

If yes, in object-orientated programming languages, "customer", "message" will be object of class which you will create for them.

Change of attribute can trigger event.

The activity will be a method of the class that will do something to the object, change attributes and possibly trigger some events.

Events and event-handlers are used to let an unknown class/object learn about changes made to an object.

See how this is implemented in Java:

https://docs.oracle.com/javase/7/docs/api/java/beans/EventHandler.html

https://docs.oracle.com/javase/tutorial/uiswing/events/intro.html

Event object contains detailful information about the event. e.g. event with information about mouse click will have x and y position of mouse where click occurred and which mouse buttons were clicked or released.

 

For GUI window, attribute will be opened=false or opened=true, with activity-method open()/close(), with events: opening, opened, closing, closed. User (some class e.g. button, listview, application etc.) of window will add event-handler listening for arriving opened event, or closed event, and do something with this information.

Edited by Sensei

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.