I have a user class that hold user names, emails and related methods that needs to write to a database. Passing a database object or database variables to the class so it can write to the database seems odd to me. Is this the correct way or is there some other standard?