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

  • Home
  • SEARCH
  • 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 782695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:25:37+00:00 2026-05-14T20:25:37+00:00

I am building graphs. A graph consists of nodes linked each other with links

  • 0

I am building graphs. A graph consists of nodes linked each other with links (indeed my dear).
In order to assign a given behavior to each node, I implemented the strategy pattern.

class Node {
    public BaseNodeBehavior Behavior {get; set;}
}

As a result, in many parts of the application, I am extensively using type reflection to know which behavior a node is.

if (node.Behavior is NodeDataOutputBehavior)
    workOnOutputNode(node) ....

My graph can get thousands of nodes.

  • Is type reflection greatly affecting performances ?
  • Should I use something else than the strategy pattern ?

I’m using strategy because I need behavior inheritance. For example, basically, a behavior can be Data or Operator, a Data behavior can IO, Const or Intermediate and finally an IO behavior can be Input or Output.

So if I use an enumeration, I wont be able to test for a node behavior to be of data kind, I will need to test it to be [Input, Output, Const or Intermediate]. And if later I want to add another behavior of Data kind, I’m screwed, every data-testing method will need to be changed.

  • 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-14T20:25:38+00:00Added an answer on May 14, 2026 at 8:25 pm

    if (node.Behavior is NodeDataOutputBehavior) is not reflection and is very fast.

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

Sidebar

Related Questions

I'm building my own Canvas-style JPanel subclass which will draw a graph of nodes
I'm building a network graph using Three.js (ie a bunch of nodes and interconnecting
I'm building an iPad app that includes several bar graphs (30+ bars per graph)
I'm building an app that graph a text given function using DDMathParser by Dave
I'm building a website which will use files in order to render social graphs.
I'm building graph using method IGraphBuilder::RenderFile And query interfaces IMediaControl - to run video
I'm debugging some performance issues in IE8 with RaphaelJS. We're building graphs from ~1000
I'm building a graph in d3.js and appending almost 30-60 circles along with 2
I'm building a graph and verify uniqueness of a vertex to add using HashSet<T>
I'm building an Open Graph App that should be able to publish, retrieve, and

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.