642 karma · joined February 11, 2011
blog: http://andrzejkrzywda.com
At the design level - flat hierarchy
At an abstract level - thinking in terms of objects, not classes.
At GameBoxed (http://gameboxed.com/) we've got a Rails app that uses a lot of .extend on every request. It's in production for 1.5 year now.
It's a backend for multiple social games (one backend app for many CoffeeScript frontends).
It's not huge in terms of traffic and performance needs. We implemented it with a DCI-like architecture in mind. It was helpful at the beginning. DCI wasn't the only way to implement it, but it was the simplest way for us at that time.
We've had some performance problems, but they were never related to the usage of .extend. If it was a performance problem, we would probably consider removing the .extends (not a big deal), switch to Java, do more caching, there are so many options.
Again, we don't have huge performance needs, we've maybe 40 req/s at peak times.
DCI is much more than .extend, it's a huge shift in thinking about the OOP architecture.
If we (as Ruby community) agree that it's an architecture worth trying, then maybe it makes sense to introduce better optimisations techniques to the current Ruby implementations?
Anyway, it's great to see the discussion happening. DCI may not be ready to use right now, but it's more of a change in thinking than in the implementation.
I definitely wouldn't call it completely broken in Ruby.
Here are some of my posts on DCI in Ruby:
http://andrzejonsoftware.blogspot.com/2011/02/dci-and-rails....
http://andrzejonsoftware.blogspot.com/2012/01/dci-and-rails-...
http://andrzejonsoftware.blogspot.com/2011/08/dci-patterns-h...
That sounds a bit too generic. There are possibly some libraries that group other libraries, but are not really a framework.
It's great to have it in irssi as well. Testing it!
BTW, when does someone create a working implementation of IRC-based webchat? Please, don't mention grove.io...
As a programmer, it both - kind of scares me and excites me.
Count me in, I'm interested!
Users do not accept invites to new apps anymore. Notifications can be used to increase the retention (with give-a-life, send-a-life feature).
As for the main point, I agree that JS stdlib is almost non-existing and can't be relied on. Libraries like underscore.js or sugarj.js fill the gap and compete for the community-stdlib.
Good post!
You haven't used MVC, you have probably used Model2. The post we're discussing is about MVC.
http://andrzejonsoftware.blogspot.com/2011/09/rails-is-not-m...
Server MVC (Model2) is not the same as client MVC (the classic one). They are totally different architectures. Patterns that apply to one, don't apply to the other.
You can't get MVC with Rails/Django/Struts. You can get a nice MVC with a Single Page Application or with a desktop app.
A similar discussion was already here: http://news.ycombinator.com/item?id=3035549
"(...) how happy they where not not have to deal with UI requirements and be able to focus on the business logic."
I've noticed the same, but I still don't understand why is that.
I'm curious why so many backend developers are not happy with working on the frontend part?
The idea is that the Data doesn't change that often, so it's kept separate from the things that change frequently - roles, use-cases.
Exposing use-cases is also an important goal, usually they are scattered across the codebase.
Theory:
1. Expose use-cases (context) as first-class citizens of your code.
2. Each use-case selects which objects are needed for this use-case.
3. Extend the objects only with the roles that are needed in this use-case.
4. Start the interaction.
Example:
Buying a product.
1. UserBuysAProduct object, that can be executed.
2. Objects/actors needed: user, shop
3. Extend user with a Buyer role and shop with ProductCatalogue and OrderManager.
4. call shop.buy_product(user, product)
There's one more reason why I want to clarify the situation with terminology.
Apart from being a Rails developer and running a Rails company I also teach Ruby on Rails at a university.
Obviously, I'm not the single source of knowledge for the students, however I want to clearly explain to them what is Rails, what is MVC and what is Model2.
It doesn't help me that when they go to any Rails website there's information that Rails is MVC, which is not.
Here and on my blog you can find comments from people who are confused with the current situation. I'm not expecting that today we're going to agree on any solution. I just want to point out that the definitions and their usage are not precise.
MVC - MVC is separated, Models can notify Views.
Model1 - mixing all code in one place, often seen in first PHP apps
Model2 - separation between Model and View, I think Struts started it. Rails made it prettier.
Yes, the gain from correcting the confusion may be small. However, the topic of JavaScript MVC is going to be huge soon, good to know the differences.