BOb
2006-Mar-10 13:59 UTC
[Rails] Ruby for presentation layer, C# for business layer - how to
For reasons not relavent, I would like to create an n-tier app as follows. Data Acess layer => NHibernate Business layer => C# Presentation layer => RoR All of which might be spread across multiple machines in each layer. I am looking for the best way to allow RoR to talk to my business layer, dll''s etc hosted on another box. The RoR box might be *nix \ apache or windows \ IIS \ Apache. The C# box might be mono \ *nix or .net clr \ windows. My immediate thought was web services to perform the execution of data access and business processes, but is there a better way ? Can I instanciate remote c# objects from RoR ? Can I get an array of data returned from c# dll ? Many thanks for any advice BOb -- Posted via http://www.ruby-forum.com/.
ntollervey
2006-Mar-10 14:17 UTC
[Rails] Ruby for presentation layer, C# for business layer - how to
Beggars the question why? (I''m assuming you already have a legacy .NET/NHibernate back-end you want to use otherwise this looks like a fine can of worms to open. Why complicate matters with multiple environments when RoR (and .NET actually but not as fast or fun) will do it all for you?) Nicholas BOb wrote:> For reasons not relavent, I would like to create an n-tier app as > follows. > > Data Acess layer => NHibernate > > Business layer => C# > > Presentation layer => RoR > > All of which might be spread across multiple machines in each layer. > > I am looking for the best way to allow RoR to talk to my business layer, > dll''s etc hosted on another box. > > The RoR box might be *nix \ apache or windows \ IIS \ Apache. > > The C# box might be mono \ *nix or .net clr \ windows. > > My immediate thought was web services to perform the execution of data > access and business processes, but is there a better way ? > > Can I instanciate remote c# objects from RoR ? > > Can I get an array of data returned from c# dll ? > > Many thanks for any advice > > BOb > >
BOb
2006-Mar-10 14:44 UTC
[Rails] Re: Ruby for presentation layer, C# for business layer - h
We were thinking that compiled dll''s and .net will be faster than interpreted RoR \ Ruby and also we have much more experience of C# than Ruby \ RoR. We dont like asp.net and the .net code behind style of web development. Do you really think that Ruby can compete with C# in terms of speed and breadth of functionality when used to write busines classes. I am in the process of redesigning a VB6 windows app with 150 tables>500k LOC into a modern n-tier browser based app.BOb ntollervey wrote:> Beggars the question why? > (I''m assuming you already have a legacy .NET/NHibernate back-end you > want to use otherwise this looks like a fine can of worms to open. Why > complicate matters with multiple environments when RoR (and .NET > actually but not as fast or fun) will do it all for you?) > > Nicholas-- Posted via http://www.ruby-forum.com/.
ntollervey
2006-Mar-10 15:32 UTC
[Rails] Re: Ruby for presentation layer, C# for business layer - h
BOb, When run in production mode using apache etc... your rails application will be started as several threads at a point like the Application_Start event in .NET. Only in development and testing mode is the Rails application continuously re-interpreted for each request. There are lots of good blog posts and articles about RoR performance and enhancements thereof (caching being the first thing to come to mind) floating around the Internet. With regard to business-classes, you already have a head start with Active-Record. Extend these classes to include whatever "additional" functionality you require. But, as is usually the case with RoR, someone has thought of this already and there are all sorts of mix-ins and built in methods that will let you extend active-record to suit your requirements. As a professional C# dev (by day, RoR by night :-) ) I''d say active-record beats faffing about with ADO (nice though ADO is) and really does save time. Hope this helps, Nicholas BOb wrote:> We were thinking that compiled dll''s and .net will be faster than > interpreted RoR \ Ruby and also we have much more experience of C# than > Ruby \ RoR. > > We dont like asp.net and the .net code behind style of web development. > > Do you really think that Ruby can compete with C# in terms of speed and > breadth of functionality when used to write busines classes. > > I am in the process of redesigning a VB6 windows app with 150 tables > >> 500k LOC into a modern n-tier browser based app. >> > > BOb > > ntollervey wrote: > >> Beggars the question why? >> (I''m assuming you already have a legacy .NET/NHibernate back-end you >> want to use otherwise this looks like a fine can of worms to open. Why >> complicate matters with multiple environments when RoR (and .NET >> actually but not as fast or fun) will do it all for you?) >> >> Nicholas >> > > >
brabuhr@gmail.com
2006-Mar-10 16:14 UTC
[Rails] Ruby for presentation layer, C# for business layer - how to
BOb wrote:> For reasons not relavent, I would like to create an n-tier app as > follows. > > Data Acess layer => NHibernate > Business layer => C# > Presentation layer => RoR > > All of which might be spread across multiple machines in each layer. > > My immediate thought was web services to perform the execution of data > access and business processes, but is there a better way ?If you find a better way, I''d be interested in hearing about it. I currently have an app running like this: RoR --SOAP--> C# --Proprietary Assembly--> Proprietary Data Store I briefly looked at embedding Mono as a Ruby extension so I could try to load the assembly and talk directly to the data store; but, didn''t think it was worth the effort since I don''t know how to use the proprietary API anyways. The setup as is works pretty well from the RoR end of things; I had to do more work on my model, since I lose ActiveRecord''s magic. But, it was actually much easier than I anticipated to do so. I mimicked ActiveRecord''s methods in my SOAP model and was able to hook my view and controller up to a MySQL model to make it easier for testing and development and then back to the SOAP model for production. (Actually production is currently running on the MySQL backend because,) The only problem so far is that the webservice was very slow once it actually had more than a few records. Next week we should have an updated web service deployed that, I''m told, is orders of magnitude faster.
Justin Bailey
2006-Mar-10 16:55 UTC
[Rails] Ruby for presentation layer, C# for business layer - how to
Take a look at John Lam''s RubyCLR bridge. It''s windows only, but combine that with Ruby DRB and you may have a way to use .NET''s remoting w/ Ruby. http://www.iunknown.com Note it''s still under very heavy development, so it may not be robust enough for your needs. On 3/10/06, brabuhr@gmail.com <brabuhr@gmail.com> wrote:> > BOb wrote: > > For reasons not relavent, I would like to create an n-tier app as > > follows. > > > > Data Acess layer => NHibernate > > Business layer => C# > > Presentation layer => RoR > > > > All of which might be spread across multiple machines in each layer. > > > > My immediate thought was web services to perform the execution of data > > access and business processes, but is there a better way ? > > If you find a better way, I''d be interested in hearing about it. I > currently have > an app running like this: > > RoR --SOAP--> C# --Proprietary Assembly--> Proprietary Data Store > > I briefly looked at embedding Mono as a Ruby extension so I could try to > load the assembly and talk directly to the data store; but, didn''t think > it > was worth the effort since I don''t know how to use the proprietary API > anyways. > > The setup as is works pretty well from the RoR end of things; I had to > do more work on my model, since I lose ActiveRecord''s magic. But, it > was actually much easier than I anticipated to do so. I mimicked > ActiveRecord''s methods in my SOAP model and was able to hook my > view and controller up to a MySQL model to make it easier for testing > and development and then back to the SOAP model for production. > > (Actually production is currently running on the MySQL backend > because,) The only problem so far is that the webservice was very > slow once it actually had more than a few records. Next week we should > have an updated web service deployed that, I''m told, is orders of > magnitude faster. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060310/19715495/attachment.html
Dean Wampler
2006-Mar-11 02:20 UTC
[Rails] Ruby for presentation layer, C# for business layer - how to
I haven''t done this with .NET, but you might investigate lightweight technologies like JSON, Hessian, Burlap, etc. as alternatives to SOAP for communicating between the layers. dean -- Dean Wampler http://www.aspectprogramming.com http://www.newaspects.com http://www.contract4j.org