In the case of the OP's example with resolution of the application something that can change during the course of using the app.
If I had a button that had its alignment based on the resolution and it needed to know those parameters and my button setup was a different class than my windows/application class I would (in the constructor) pass a pointer to the original resolution variables on my windows/application class.
int * ResoultionXPTR;
int * ResoultionYPTR;
In this case I would try to design a way for buttons to define their alignments without directly referencing the screen resolution (perhaps not unlike HTML can be resolution independent). But if the buttons absolutely had to know the screen resolution I would give them a pointer to the active render target when it is being updated rather than raw pointers to integers at construction:
[source lang="cpp"]
// Only construction parameters, no dependencies.
Button::Button(int width, int height, const Vector2& origin) :
width(width), height(height), origin(origin) {
// Initialize the button.
}
void Button::update(const RenderTarget* renderTarget) {
// Cover entire screen.
origin = Vector2(0, 0);
width = renderTarget->getWidth();
height = renderTarget->getHeight();
}
[/source]
However, like I said before, I really don't think a button needs to know about the screen resolution.