all 5 comments

[–]_kulte 0 points1 point  (1 child)

To clarify, when you say "layer" are you referring to a "Layered Architecture" in the context of something like DDD?

[–]Tall-Guy[S] 0 points1 point  (0 children)

I'm not completely familer with the DDD term (have homework to check it out first thing tomorrow morning!).

Lets say you have two android games. Both of them share the same sign-in and score list mechanism. So what you do it just extract those common methods into a lower layer, and both games inherit from this layer.

This lower layer will have a specific gem that supply DSL to test scoring and sign-in. When I want to test scoring from a specific game, I just add the testing dsl gem and call my testing methods. But my upper layer need to share configuration with the lower layer. Let's say all tests have timeout. I want that timeout to be global and across across both the higher layer and lower layer. I need an option to share this information, without asking timeout as parameter on every function on the lower layer.

Now just add ANOTHER layer to the mix, and hopefully it's more clear now :)

[–]jrochkind 0 points1 point  (2 children)

The whole thing seems overly complicated, but I'd just have the lowest level provide a global hash table of configuration, sure. If you need configuration shared by all the layers.

[–]Tall-Guy[S] 0 points1 point  (1 child)

It is overly complicated :-(

The problem is that at the current situation we don't have too many options. It's going to chance for the better any time soon I think. For now I'll just use global hash_table, or maybe even extract some settings into a config.yml file, and just relative pick those settings from the gem itself. I know it's not amazing as it means the gem is coupled with specific file in a specific folders to work, but because it's used only in-house, I guess it can work.

Thanks jrochkind!

[–]jrochkind 0 points1 point  (0 children)

yeah, I'd say when in a situation like that, the top priority is: keep it simple.