Your two sentences would make more sense if they were:
If I want to save and retrieve an object, should I create another class to handle it, or would it be better to do that in the class itself?
You started a question, so your phrases should all be questions (as mentioned by Sarah). When you are using "it" in "would it be better", you are talking about the situation you will be in if you follow that path.
Or:
If I want to save and retrieve an object, should I create another class to handle it, or would I be better off doing that within the class itself?
Changing the code won't improve you as a person, no matter what your boss might say! That means that "I'd be better" isn't true.
As in your first sentence, your situation might improve, so you might be "better off". Note that "would" still comes first, because you are still asking a question.
"I'd better" is short for "I had better" so:
If I want to save and retrieve an object, should I create another class or had I better do that in the class itself?
This is a less common way of asking for a comparison of two options, however.
It is probably simpler (and easier to understand) if you ask the question using the same type of phrase in both halves:
If I want to save and retrieve an object, should I create another class to handle it, or should I do that within the class itself?
If I want to save and retrieve an object, would it be better to create another class to handle it, or do that in the class itself?