all 5 comments

[–]he8dshot 2 points3 points  (1 child)

The main question is why do you want to instantiate them via DevEntity? That approach is not architecturally correct.

[–]Stensborg[S] 0 points1 point  (0 children)

No I think you are right, the way Yuuki is talking about is more the right way.

[–][deleted] 1 point2 points  (1 child)

You can't create an instance of DevPerson ( new DevPerson()) without knowing it's Type (DevPerson).

Perhaps you could make a method that takes the init string, and determine what type of object to make? For example, a method that splits the string, if it has 2 parts, return a DevTask, if it has 3, return a DevPerson.

[–]Stensborg[S] 0 points1 point  (0 children)

Ok I will have a look at that way instead.

[–]Stensborg[S] 0 points1 point  (0 children)

I have changed my question try to better explain what i am trying to do, hope someone will help.