Hi
I knew I can write my own custom classes to do that. But I also knew the prototpye of the String is a Structure, not a Class. I seem to remeber that a Structure costs less than a Class. And when a huge number is involved, Structures can save some resources. That's why I want to use the Strings.
For extra information, there are lots of them. For example, I may need the mass, stiffness for computing. I don't think AutoCAD has something like those,haha.
String is a class, not a struct.
A struct is a type that is passed by value, and if strings were structs or value types, then
an entire string's contents would need to be copied when it is passed as an argument to
a method, etc.
you're focusing on some obscure aspect of the underlying type
system with an idea that it will serve the purpose of efficiency.
The problem with storing Line entities in a List<Line> is that they are not usable outside
the scope of the transaction you get them from, and so you can't simply keep them around
for use whenever you need them.
How you should persist your information about Lines (or any other object for that matter)
depends on what you need to do with it. For example, you could persist data in the form
of XML or JSON (both of which can be represented as strings, BTW), or you could use your
own custom class or struct and store what you need in them.