Hey Guys I am thinking of developing a Speckle-Kit but I struggle to figure out how many representations I need for my Data. Imagine I have a c# project with some data types I want to move around through speckle. One way is to create a speckle-Kit. So let’s say my data can be described by this class and lives on the main project (AwesomeProject).
public class Pt
{
public double X;
public double Y;
}
Next I need to create a speckle-kit for this data type. So here I go again…but now on a different project.
public class AwesomeProject_Pt : SpeckleObject
{
public override string Type { get; set; } = "AwesomeProject_Pt";
public double X;
public double Y;
}
What goes through my mind is that this is slightly problematic, because I now need to maintain two different projects with essentially the same data.
-
Now I can see an obvious work around, would be to ditch my first class and just use the one that extends the SpeckleObject but then I am including on my data some very Speckle Specific properties + people using my code will have to work with Speckle as well adding to the complexity.
-
Another neater solution might be, that since there is a lot of repetition, we can have a post-build event that auto-generated the Speckle-Kit for you and publishes a new .dll so that Speckle would like it. This seems simple so I wonder if anyone else has done it / is seeing some obvious problems with that?
-
And finally (!), there could be some sort of smartness from the Speckle-side for objects with primitive or known objects. So you can say if on my Kits folder I have a .dll with some classes (maybe they implement something like an interface?) I can then investigate and see if I can convert them to SpeckleObjects through magic of course. The point being is that things might not be pretty, but you can convert them without much of a problem.
-
Do I just use json and pass a string to Speckle? Am I now losing a few things there though? Like auto instantiating objects on the different clients etc…?
I feel like all of them have advantages / disadvantages and I was wondering if you guys have any thoughts on what is the best way to proceed!
Sorry for the long post (does anyone now if we can host potatoes on Speckle streams?) ! I am hoping this has a very obvious answer that I am missing