Application 1 is an auditing application called AuditSystem.
Application 2 is a quality control appllication called QC.
App1 has a couple of classes, including models, that i would like to use
with App2. I would like a change in a class to be felt in both
applications. How do i acheive this without copying and pasting code??
At the moment im feeling i should have made the whole thing one
application, but that would be wrong.
Also is it true that 2 applications have to be hosted on 2 different
servers??
You might make your code a plugin
(http://wiki.rubyonrails.org/rails/pages/HowTosPlugins). If you are
using svn for your project and you decide to use a plugin design and are
using subversion as version control the power of svn:externals as
described in Peak Obsession might
come in handy. Updating the trunk of every project using your plugin is
then a matter of ‘svn up’.
[…]
App1 has a couple of classes, including models, that i would like to use
with App2. I would like a change in a class to be felt in both
applications. How do i acheive this without copying and pasting code??
At the moment im feeling i should have made the whole thing one
application, but that would be wrong.
Once upon a time, there was something called “Poductize” which enabled
you to do exactly this. Last time I checked it (had become||was
replaced by) an engine.
Also is it true that 2 applications have to be hosted on 2 different
servers??
On a shared host (pendrell.textdriven.com) I (along with many others
no doubt) have at least 3 rails app served by the same lighttpd
process. So I guess the answer to this is : not true.
Engines are more like ‘super-plugins’, and provided a sort of
‘inverted’ version of Productize. In a nutshell, if you want to share
views and controllers as well as models, you might want to use an
engine:
Geez… who would have thought that you had to mess around with engines
and the like just to share code?? thats 1 thing thats easier in java.
I suppose this is why ROR is sometimes said to be not very scalable?
Any comments on this?
I NEED to convince my boss that ROR is scalable (in terms of size not
number of hits). Any ideas what i can say? I write enterprise
(debateable) software for our organisation.
Geez… who would have thought that you had to mess around with engines
and the like just to share code?? thats 1 thing thats easier in java.
Coming from a java background, I don’t find code sharing harder in
Rails than J2EE. Using plugins to share library code scales very
well, right from a few shared methods up to large code libraries.
Certainly no more difficult than using jars.
If you want to share more than just ruby code (including controllers
and views), then as James says, engines provide a sort of ‘super
plugin’ system. I don’t know of any equivalent facility in J2EE.
I suppose this is why ROR is sometimes said to be not very scalable?
Any comments on this?
I NEED to convince my boss that ROR is scalable (in terms of size not
number of hits). Any ideas what i can say? I write enterprise
(debateable) software for our organisation.
Rails tries as hard as possible to be as concise as possible, so you
never have to write more code than you need. This results in far less
code for the same functionality as you’d write in J2EE (rough
estimate, less than half the code). Less code = less maintainance.
Rails also makes it extremely easy to write both unit and functional
tests, building confidence into your code as your application gets
larger.
Geez… who would have thought that you had to mess around with
If you need to share models across apps and they are on the same
server why not take the simple route and use symlinks or
svn:externals. I am doing this to share a base set of models over 4
apps myself and it works great.
On Mon, Jan 09, 2006 at 01:50:42PM +0100, Jean H. wrote:
} On 1/9/06, Chris [email protected] wrote:
} >[…]
} > App1 has a couple of classes, including models, that i would like to
use
} > with App2. I would like a change in a class to be felt in both
} > applications. How do i acheive this without copying and pasting
code??
} > At the moment im feeling i should have made the whole thing one
} > application, but that would be wrong.
}
} Once upon a time, there was something called “Poductize” which enabled
} you to do exactly this. Last time I checked it (had become||was
} replaced by) an engine.
}
} > Also is it true that 2 applications have to be hosted on 2 different
} > servers??
} On a shared host (pendrell.textdriven.com) I (along with many others
} no doubt) have at least 3 rails app served by the same lighttpd
} process. So I guess the answer to this is : not true.
Even more to the point, I have a Rails app running from a path on my
main
Apache2 server. I could have any number of Rails apps running from other
paths without the need for virtual hosts or anything.
Please read the original link I posted for clarification about when
engines are more suitable than, say, generators or plugins, because as
Ezra pointed out, if you only want to share model code SVN externals
are fine, and basic plugins are adequate for keeping those shared
files in a container.
What I qualify as an enterprise setting:
client-focused development (as opposed to, say, web 2.0
personal-user-centric sites)
many developers working with version control and QA
If you need to share models across apps and they are on the same
server why not take the simple route and use symlinks or
svn:externals. I am doing this to share a base set of models over 4
apps myself and it works great.
I think the advantage of this is that your app still feels like a
‘rails’ app. I tried developing with engines on a serious app, but I
really didnt like the way it split up my models and controllers.
Views, however, are a different story. I think if you absolutely
need that, maybe Engines are better.