I'm fairly new at event driven programming and using MVC so forgive me if this question seems like a non-question.
I'm trying to assign values to my singleton model class (Client). I have 2 options:
I can use the model class constructor to assign to itself like so:
Class Client{
public var name; public var email; public function Client(arg_name, arg_email){ this.name = arg_name; this.email = arg_email; } }
I can use the controller to assign my values for me like so:
Class Controller{ public var client:Client = new Client(); public function assign(){ client.name = "booo"; client.email = "blaaah@email.com"; }
}
Which one of these is a better solution? :) The reason why I'm so confused is cause I've seen examples that just pass values to the model class and do #1 (and setting new variables such as [var fullname = fname + lname], yet I know for a fact that it is the controller's job to assign values to the model.