Extended Types and Create()

BlitzMax Forums/BlitzMax Programming/Extended Types and Create()

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

One option for a framework would be to use a lighweight Object as the creation parameter this would then allow extensions and get around this limitation.

Or you could use the Builder or Factory patterns, where you assign another object to create/setup the desired object. Sounds complex but can be very good for complex objects that need to be constructed and would otherwise require a very complex setup process. In effect you simplify the created object by letting another object create it.

E.g. Wall object made from lots of bricks in a pattern.
Bricklayer object creates bricks and places them in the pattern within the wall in the correct order.
Now the Wall object can concentrate on being a wall not a bricklayer as well.

But as Macguffin says just renaming the Create() method/function Construct() and then call Create() with the base parameters.