1
vote
1answer
72 views

Should I use the new method/action to retrieve records? (Rails)

I have an admin controller that is just used for its index action which renders a view with the most recent updates to certain resources: class AdminController < ApplicationController ...
2
votes
3answers
431 views

Is the Observer pattern adequate for this kind of scenario?

I'm creating a simple game development framework with Ruby. There is a node system. A node is a game entity, and it has position. It can have children nodes (and one parent node). Children are always ...
2
votes
1answer
114 views

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

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, ...
2
votes
1answer
278 views

How does dependency inversion principle work in languages without interfaces?

In C#/Java, the dependency inversion principle is often demonstrated by high-level classes that depends on an interface/abstraction (that it owns). Low-level classes will implement the interface, thus ...
2
votes
1answer
250 views

Attempt at understanding the double-dispatch pattern

I've been trying to grok the double-dispatch pattern and having a hard time. I finally attempted a sample program to help myself understand. Here's the gist. But then I decided to attempt it without ...
0
votes
1answer
262 views

Online stores service design

I am designing an online store service app with rails. Everyone who wants to make his/her own store can do it with this app by just signing up and choosing a domain. I want to make it as SaaS as it ...
20
votes
5answers
987 views

How to avoid giant glue methods?

In my current job, I've been tasked with cleaning up old code a few times. Often the code is a labyrinth and the data behind it is even more tangled. I find myself combing out things into nice, ...
2
votes
1answer
265 views

Does it make sense to create a Ruby wrapper to reference a Java object that does exactly the same thing?

I am using JRuby. In my Java code, I have a class called Texture, capable of doing some graphic manipulation stuff. In my Ruby code, I will usually need to draw things, so though I should simply ...
7
votes
2answers
939 views

Open/Closed principle and reopening Ruby Classes

In OOP there is the Open/Closed principle that states that "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification". Taking in ...
7
votes
2answers
578 views

Do Ruby (and other dynamic language) programmers use IoC / Dependency Injection?

I'm primarily an ASP.NET developer and the single thing i've been introduced to in recent years that has had the most dramatic impact on the quality of the code I write has learning how to use IoC ...