By day I am a .NET ASP.NET MVC developer but by night I'm working on an e-commerce application built in RoR 3.1.
We are starting with one payment processor with the understanding that we'll be moving to another one in 6 to 8 months. I don't want to repeat code so if I were doing this in .NET, I'd create an interface and create a class to implement that interface. I'd create two classes for each payment processor and then just use dependency injection to specify which one to use like:
ninjectKernel.Bind<IPaymentProcessor>().To<PaymentProcessor1>();
and then when we switch all I'd have to do is change that one line to PaymentProcessor2.
Are there any tutorials you know about or code samples out there that would lead me down the same path for ruby on rails? I know ruby is dynamic and I won't need an interface.
Any guidance would be greatly appreciated.
Thanks!