How do I know when should I package my classes in Ruby?

Posted by Omega on Programmers See other posts from Programmers or by Omega
Published on 2013-07-02T06:27:08Z Indexed on 2013/07/02 11:14 UTC
Read the original article Hit count: 314

Filed under:
|
|

In Ruby, I'm creating a small game development framework. Just some personal project - a very small group of friends helping.

Now I am in need of handling geometric concepts. Rectangles, Circles, Polygons, Vectors, Lines, etc. So I made a class for each of these.

I'm stuck deciding whether I should package such classes in a module, such as Geometry. So I'd access them like Geometry::Rectangle, or just Rectangle if I include the module.

Now then, my question isn't about this specific scenario. I'd like to know, when is it suitable to package similar classes into one module in Ruby? What factors should I consider? Amount of classes? Usage frequency? Complexity?

© Programmers or respective owner

Related posts about design-patterns

Related posts about ruby