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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:25:53+00:00 2026-06-13T17:25:53+00:00

I’m building an application that supports plugins over a generic type of data. Problem

  • 0

I’m building an application that supports plugins over a generic type of data. Problem is, I can’t seem to specify a generic condition that allows everything I need to pass through, here’s the details of the code:

abstract public class PluginObject<ManagedType>
abstract public class Plugin<EditedType> where EditedType : PluginObject<Object>

The <Object> here is the problem, when I create my classes and plugins, I’ll create models to handle the data aspect of the plugin. To this end, my first plugin has many items to manage and I can’t really create a sub class of them all, so I ended up create an interface IOrderObject that doesn’t contain anything.

Therefore, I ended up with:

  1. SynchronizableObject
  2. TripRoute
  3. TripRouteDirection
  4. ITripObject (Interface implemented into #2 and #3)

This way I can do:

public class RoutePluginObject<ManagedType> : Activis.Framework.Admin.PluginObject<ManagedType>
public class RouteManagementPlugin : Activis.Framework.Admin.Plugin<RoutePluginObject<Transdev.Limocar.iTripObject>>

And it is accepted, but the problem is that ITripObject is an interface not an object, so it can be converted to PluginObject<Object>.

So my question, is there a way to specify a condition that would allow something similar to this:

abstract public class Plugin<EditedType> where EditedType : PluginObject<Any>

This way, interfaces or objects could be provided by I don’t really care about this condition; all I want is that my Plugin‘s editedtype be a PluginObject of anything possible.


EDIT

Having better results with the covariance but still getting an error, i haven’t seen anything about the PluginObject inheritance in your examples (Matias), here is what i did:

public interface IPluginObject<out ManagedType>
abstract public class Plugin<EditedType> where EditedType : IPluginObject<EditedType>
public class RoutePluginObject : Activis.Framework.Admin.IPluginObject<TripRoute>
public class RouteManagementPlugin : Activis.Framework.Admin.Plugin<RoutePluginObject>

But i still get errors at the RouteManagementPlugin with:

The type ‘Transdev.Limocar.Admin.RoutePluginObject’ cannot be used as
type parameter ‘EditedType’ in the generic type or method
‘Activis.Framework.Admin.Plugin’. There is no implicit
reference conversion from ‘Transdev.Limocar.Admin.RoutePluginObject’
to
‘Activis.Framework.Admin.IPluginObject’

Unless i misunderstood covariance (which is probably the case) i seem to have followed your example clearly, still not getting it working…

  • 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-13T17:25:55+00:00Added an answer on June 13, 2026 at 5:25 pm

    You just need a second generic parameter:

    abstract public class PluginObject<ManagedType> {}
    abstract public class Plugin<EditedType, OtherType> where EditedType : PluginObject<OtherType>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I've tracked down a weird MySQL problem to the two different ways I was

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.