0

Let's say for example that I'm making a tile map editor.

We have the editor, which handles the drawing of the tiles, and we have the tileset which is used to determine what tiles are drawn.

The editor needs to depend on the tileset to know which tiles should be draw, and the tileset needs to depend on the editor to know the dimensions of the tiles to be drawn, as well as other minor details.

This creates tightly coupled code. Is this a code smell? If so, how do I resolve it?

Do I stuff everything into a large class? Do I use a mediator to communicate between the two classes?

3

1 Answer 1

-1

Write your tile-set first complete with tests, then move on to the editor. In so doing you will have solved your problem without even considering it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.