Ultimately, it is about preference, generally speaking, it is bad practice to deal directly with the request context or it’s request collection in your models. The rc is basically your form and url variables and your models shouldn’t really be tied to your form fields and query strings. You should always account for the fact that you might want to update account info from a web service, from an event gateway, or from a different client front-end like Flash. It’s handy down the road to have a clear separation between your business logic that does stuff, and the parts of the framework that deal with plumbing of HTTP.
You also want to have a clear API for your service methods documenting what they take in and what they send back. If your service method directly accesses the request context, it’s breaking encapsulation and the contract between it and your handlers is very loose.
Out of your options, I would suggest your second example where you pass rc.fName and rc.lName in as separate arguments. That is the most reusable and self-documented.
I can see two things. 1) pass the entire rc and keep all the arguments in one variable in your method. easy. no need to write more if you pass more values. 2) pass each variable on its own. its more explicit. more “written out” and more transparent. you know exactly what the method will need to run correctly.
also, best practice with models is dont include session, application, client data.
Seems everyone would agree to pass arguments to the method rather than access the context from within the method.
And from what I can gather, with the exception of compound object arguments, it best to make the method transparent in what individual arguments it’s expecting.
Without which you don’t know what a method needs from it’s API unless you read the code.
Well this is also why it is good to comment your code, which would clearly indicate what is being expected from arguments (inputs) and what it returns (output).
There is no hard fast rule, that says you have to do passing. But decoupling the model means it becomes decoupled and able to be reused with out external dependencies, which is what everyone is basically hinting at. But it is ultimately your choice on what you want from the model or business logic.