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 9153879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:20:41+00:00 2026-06-17T12:20:41+00:00

I just stared looking into Poco framework. I have another underlying framework that already

  • 0

I just stared looking into Poco framework. I have another underlying framework that already was using Poco framework and abstracting some parts of it to make it even more easier.

I want to explain the problem with a simple scenario:
Consider that I have a rectangle shape object in my program. The shape has private hit Testing methods inside to it and on hit testing being true for a certain time, I had to fire a function in another class i.e my Fountain class.

I don’t need to pass any specific object information of shape to the function in the Fountation class. My framework already gives me some functionaliy of NotifyEvent and AddListener. If I would have gone by this approach, I would have an event inside my shape class which would be subscribed in fountain by Add Listener (object if shape is passed) and the event notified from within the shape class.

Now, with the Poco notification center, instead of passing the shape object reference to foundation class, I’ll be passing the NotificationCenter reference to the second class. The fountain class will then have an observer and the observer will be notified from shape by postNotification()
The only difference that I see here between the two approaches is not passing the specific object information.
I am just a fresher dev here trying to learn good coding practices whenever possible, and not clear about the decoupling here. How are the two classes decoupled here? (because I am not passing shape object and just using notificationcenter object?)

EDIT: Adding to the above question. Let’s say I have 10 other classes which have to listen to a certain notification, so I’ll have to pass the reference of the Notification Center to all these classes as well? That way only I’ll be able to add an observer for the notification center in my classes.

  • 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-06-17T12:20:42+00:00Added an answer on June 17, 2026 at 12:20 pm

    Basically yes. If the Fountain class only knows about the NotificationCenter, then it is not coupled to the shape (Rectangle or others) anymore. This assumes that the notification posted by the shapes is also not dependent on the object that fires it.

    Edit: The reply to your edit is yes, you’ll need to call the addObserver method with each object that needs notifications

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

Sidebar

Related Questions

Just some days ago I started looking into a unit test framework called check,
I just started today looking into Groovy. I consider using it to replace some
I have just started looking into using Modules in Flex and would like to
I have just started looking into jquerymobile, done simple samples using jquery.mobile-1.0a1 . I
I am just getting started couchdb and have been looking into writing couch apps.
Just started looking into encryption using keys and certificates in sql server 2005/08 and
I just started looking into SQLite for the iPhone SDK. I have been looking
I have just started looking into .net MVC and I really like it. There
I have just started looking into msbuild, because I want to make my own
Just started looking into Entity Framework and the new Code-First features. My question is

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.