Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 733373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:15:01+00:00 2026-05-14T07:15:01+00:00

Events are really awesome, and I wouldn’t know what I would do without them,

  • 0

Events are really awesome, and I wouldn’t know what I would do without them, but they’re a mystery to me.

I’m talking about events in a sense, a function(s) is called if a property, or value, a special event happens.

I have only the vaguest idea how these actually work. I know it’s an observer pattern, but I don’t truly know how it works and/or how to implement it.

Can someone explain that to me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:15:01+00:00Added an answer on May 14, 2026 at 7:15 am

    As I understand it you are asking how events work under the covers. You haven’t specified which language/platform you are asking about so I’m going to answer with what I know (.Net), although I’m sure a lot of platforms are similar bear in mind that what I say might not be true everywhere.

    I’ll start from the lowest level and work upwards.

    Function pointers

    In most languages there is the concept of a function pointer. In languages like C++ you can literally store a pointer to the memory address of a method. In functional languages like Lisp or F# functions are key and it’s a crucial part of the language that you can store and pass function references around. In .net, function pointers are implemented using delegates.

    Delegates

    In .Net events are implemented using delegates. A delegate is a type safe function pointer. It’s a pointer to a function, that is restricted to a specific type, and checked against that type at compile time. You can trigger the delegate and that will call the function it points to.

    Multicast

    A multicast delegate is a class that forms a collection of delegates. It uses a list internally to store multiple delegates. When you call add or do += you are just adding your new delegate (function pointer) into the multicast’s internal list. Multicast delegate instances can be triggered and it simply moves down the list and triggers internally each delegate in sequence.

    Event

    An event is just a keyword that adds a few extra restrictions on top of the multicast delegate that underpins the event. For example (amongst other things) by using the event keyword when you declare the multicast delegate instance it restricts it so that it can only be triggered from within the class it is declared in.

    So, to sum up. Events are just a list of function pointers. When you subscribe you simple add a pointer to your function to the list. When the event is triggered it simply moves down the list and triggers each function pointer it knows about.

    Obviously, like I said at the start, every language/environment will differ, but I wouldn’t be surprised if the idea of maintaining a simple lists of function pointers is probably fairly common.

    Jon Skeet has an excellent article on events in .Net that you should read for more information if this is the platform you are interested in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see that Selenium 2 now supports WebDriverEventListener but the events don't really seem
I'm really not sure how to approach this, but I am subscribing to events
I'm asking this because I really don't know where I should handle events of
This really is a noobish question, but I honestly don't know how to solve
It's really easy to listen to UIEventTypeRemoteControl events, to respond to play/pause commands etc.
I'm only really beginning IOS development but have a few years dev of ASP.net
This might seem like a really dumb question, but I am writing an application
What purpose do protected or private (non-static) events in .NET really serve? It seems
I'm really embarrassed to ask such a trivial question but debugging some software now
I really would like to use the getBuffer:length: method of an NSInputStream. After a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.