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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:07:27+00:00 2026-06-15T11:07:27+00:00

I have a socket communication subsystem accessible by SocketContext facade, the only public class

  • 0

I have a socket communication subsystem accessible by SocketContext facade, the only public class in class library. SocketContext allows you to connect to remote endpoind, send and receive messages.

The problem is following: let’s say SocketContext consumer wants to monitor sent messages queue (send process is asynchronous).

Well, we need to add int QueueSize {get;} property in SocketContext but what happens next is we are going to find who is aware of queue size and it is a DataSocket class that SocketContext is not aware of, so to pull that property to SocketContext i have to wrap it multiple times like this:

// DataSocket -> Connection -> SocketClient -> SocketContext

internal class DataSocket
{ 
  public int QueueSize { get{ /* calculating and returning actual value */ }}
}

internal class Connection
{
   IDataSocket _dataSocket;
   int QueueSize { get{ return _dataSocket.QueueSize; }}
}

internal class SocketClient
{
   IConnection _connection;
   int QueueSize { get{ return _connection.QueueSize; }}
}

public class SocketContext
{
   ISocketClient _client;
   int QueueSize { get{ return _client.QueueSize; }}
}

What am i doing wrong?

  • 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-15T11:07:30+00:00Added an answer on June 15, 2026 at 11:07 am

    SocketContext facade, the only public class in class library.

    I would say this could be one of the first problems. if there is only 1 public component then it makes it very difficult to expose functionality. This also fails concepts like single responsibility, open/closed design and interface segregation. you basically have 1 object doing everything.

    There may be a single access point like the SocketContextFacade, but that is how you enter the API which can then expose other objects/components the client can interact with.

    Alot of 3rd party libraries I use usually have 2 aspects to them.

    1. Configuration
    2. Runtime

    Configuration happens once, at start up. It tells the library how to behave for your particular needs. The runtime is used throughout the system, behaving according to the configuration. Here are some examples:

    1. Entity Framework/Nhibernate
      1. Configure – DB mappings
      2. Runtime – session/dbcontext
    2. fluent validation
      1. Configuration – validation rules
      2. Runtime – validation engine and the results of validating an object
    3. Service Buses
      1. Configuration – end point routing, queue management, error handling
      2. Runtime – message handlers
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that opens a port and allows socket communication between multiple
I found JSCH library for SSH access, I have a socket: Socket socket =
I have encountered a problem of socket communication on linux system, the communication process
I have an application which does some socket communication with some hardwares. Assume for
I have ASP.NET server. I have an embedded device with cellular communication (socket based)
I have a console-based QCoreApplication which has timers and does socket communication and also
I am trying to setup secure socket communication to a server. I have successfully
I have a function for sending data over Socket class in Java. When I
Does web api have more advantage than socket communication when I am writing a
I have a VC++2008 Form Application with some unmanaged socket communication code. I want

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.