I'm developing an iPhone 3.1.3 application.
I have a class, called Object2D
, with fields and methods; which represent a shape. Object2D
has a field that represents its size, and another field that represent its type.
Now, I need another class called Pattern
, which is a set of shapes. In Pattern
I'm going to have an array of shapes. From these shapes I only need their size, their type and their location inside pattern, I don't need any method.
I'm wondering it is better to have a new struct that represent a shape instead of using Object2D
class.
I ask this because I think on memory performance. I'm not sure, but struct are smaller than classes and maybe it's better to use them instead of classes.
What do you think?