Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014
    Location
    Lynnwood, WA
    Posts
    46

    Class Design - Flexible Attributes, Child Classes, Interfaces??

    I have a project I'm working on where I have a Tree structure holding various nodes for a path with widths, corner radius, forks, etc, and I want to have the nodes each be able to have different properties. For example:

    Node 1: Position, wide
    Node 2: Position, corner
    Node 3: Position, corner
    Node 4: Position, fork
    Node 5: Position, terminal
    Node 6: Position, terminal
    etc

    wide = 3ft for 1ft
    bend = radius
    fork = multiple child nodes, may have other special properties
    terminal = terminal node

    The issue I'm having trouble understanding is how to create the class structure in a flexible way. I'd like to define the behavior of a wide,fork,bend etc in a json file and then utilize it when reading in a path.

    ASCII Art of the 'path' type idea i'm trying to represent in code:

    3/---4T----6O
    / |
    1=---2/ 5O
    (i dont think the ascii art is working so hot, spaces are deleting.)

  2. #2
    Join Date
    Sep 2016
    Posts
    4
    This is a nice and informative, containing all information and also has a great impact on the new technology...

  3. #3
    Join Date
    May 2017
    Location
    bangladesh
    Posts
    2
    Thank you so much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •