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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:31:25+00:00 2026-05-27T08:31:25+00:00

I am working on creating a Queue Manager service and its sole responsibility is

  • 0

I am working on creating a “Queue Manager” service and its sole responsibility is to add work items to the queue and remove work items from the queue. I have implemented the service as a singleton because I have some unique synchronization issues I have to deal with. Any time a new task is needed, I create a new Task object, set the parameters and then send it to the QueueManager service and have it added to a SQL Database. The Task object is serialized to the database at that time. When a process requests an item from the QueueManager, the service finds the next available work item and deserializes it back to a Task object – from there it gets returned to the client.

Technically, this works great. However, I’m not happy with having to shoehorn all types of tasks into a Task object. Work items can range from anything from copying files to updating databases. I have to add a lot of properties to the Task object that don’t mean anything to many other task types – it’s getting pretty sloppy. My first thought on how to fix this would be to have Task implemented as a base class, and then have all other tasks derive from Task. This would allow me to have work items such as CopyFileTask, UpdateDatabaseTask, DoLaundryTask, etc. I would then serialize the object to the database and add a column to tell me what the type is so I know how to deserialize it later.

The first problem I see doing it this way would be that the WCF Service needs to return just one type. That would require the service to down cast the work item (CopyFileTask for example) to Task. However, I now need to cast it back to its real type, but the client will have no idea what that type is.

I’m probably not doing a good job explaining this. In a nutshell, I need to:

  • Create a work object of any type
  • Pass it to a WCF service to have it stored in a DB
  • Call a WCF service to get a new work item (anything it finds)
  • Have that work item retuned to the client as a real (non casted)
    object

My Queue needs to be very generic since many other applications are adding and removing work items. This is being designed for a massive parallel system and will be the hub for all distributed work items. Any and all help and ideas will be greatly appriciated.

Thanks,

Scott

  • 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-27T08:31:26+00:00Added an answer on May 27, 2026 at 8:31 am

    Have you looked at ServiceKnownTypeAttribute? Have a look at the sample code on this MSDN:
    http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx

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

Sidebar

Related Questions

I am working on creating an immutable class. I have marked all the properties
I'm working on creating a domain layer in Zend Framework that is separate from
I'm working on creating a WCF web service that communicates via JSON. I got
I have been working on creating a e-commerce store using Magento and I think
I have been working on creating a PHP email form recently and cannot manage
I'm currently working on creating a new C# project that needs to interact with
I am working on creating a daemon in Ruby using the daemons gem. I
I am working on creating a tag cloud in Silverlight 2 and trying to
I am working on creating a .asmx webservice to meet the specific needs of
I'm working on creating a call back function for an ASP.NET cache item removal

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.