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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:55:15+00:00 2026-05-16T01:55:15+00:00

Perhaps this is a very basic question, please pardon me if it is —

  • 0

Perhaps this is a very basic question, please pardon me if it is — I’m a beginner in C#.

I have a WPF GUI for sending commands to a receiver. The commands are ASCII texts. Now, I separated the communication part into a separate project because I have console applications that use the communication methods in addition to the GUI. The communication DLL uses async methods on normal sockets.

Now the problem is that I will have a circular dependency. The GUI needs to call communication routines to send messages, and the routines need to call GUI to show the responses. I understand that I could make an interface which the communication inherits and get around the dependency, but is this the best way to do this? Or is this a flaw in my design? I basically wanted to decouple the GUI from the underlying communication layer.

  • 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-16T01:55:15+00:00Added an answer on May 16, 2026 at 1:55 am

    Your library (dll) shouldn’t update the GUI directly. You should have it raise events. Ideally the events would be at a higher level of abstraction as well (“Message Received Successfully” rather than “Packet Received Successfully”, but it’s really up to you how much of the low level functionality of the library you want to expose)

    The GUI (or console app or a completely different library) can now subscribe to the events and access the event data. The GUI, as a higher layer knows about the library, but the library shouldn’t know about the GUI (or the console appliation)

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

Sidebar

Related Questions

First off, please accept my apologies if this question is basic, I mainly have
I have an ObjectDataSource (but perhaps this question is the same for all kinds
This should be a very basic question, I'm still new to ruby so i'd
Very basic question I think. I have a website where some pages are likely
Disclaimer : This is a very basic question, but keep in mind I come
Perhaps this question has been asked elsewhere, but I'm unable to find it. With
This is perhaps more of a discussion question, but I thought stackoverflow could be
OK, this is perhaps stupidest question ever but bear with me.... How to make
sorry, I did not find something useful when searching google. Very basic question, mainly
I know this is a probable open ended question, and I have tried looking

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.