Quote Originally Posted by noeska
Now i can still use:
mesh1:=TModel.Create(nil);
TMsaModel(mesh1).LoadFromFile('models\hog2.txt');
as Setharian said, this is strictly not the correct use of OO. The above code would work better as ...
[pascal]var
mesh1:=TModel;
begin
mesh1:=TMsaModel.Create(nil);
mesh1.LoadFromFile('models\hog2.txt');
end;[/pascal]

if you plan to use it that way.

I disagree with Setharian on the suggestion of using enumerated types though. I think a better way and more OO way of achieving that, would be through the use of class factories. If you would like me to explain that idea further or provide a small example, let me know.