tag:blogger.com,1999:blog-7821856652257554779.post5547140810240599830..comments2023-10-22T12:47:47.534+02:00Comments on Andrzej on Software: Rails is still coolAndrzej Krzywdahttp://www.blogger.com/profile/06399276063142826365noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-7821856652257554779.post-33460894909848620602012-01-11T15:57:47.775+01:002012-01-11T15:57:47.775+01:00Do you have an examples of Rails projects which us...Do you have an examples of Rails projects which use these techniques? <br /><br />I think one of the main issues with adoption of these ideas is currently there are no real examples for people to look at. It would be nice to see PORO and DCI examples in the context of a Rails app.Kris Leechhttp://teamcoding.comnoreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-85730791559615020162012-01-04T23:57:03.536+01:002012-01-04T23:57:03.536+01:00"the future is going back to client-server&qu..."the future is going back to client-server"<br /><br />@Frank - Wait, what? I thought the future was going back to thin-client?! :-)MattBnoreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-29208054262200851272012-01-02T14:10:22.715+01:002012-01-02T14:10:22.715+01:00sorry, forgot to identify myself in the last post....sorry, forgot to identify myself in the last post. <br />I am Luiz.Luiz Costanoreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-63988936239274629202012-01-02T14:08:34.787+01:002012-01-02T14:08:34.787+01:00Hi @Andrzej
Evans doesn't talk about synchron...Hi @Andrzej<br /><br />Evans doesn't talk about synchronizing layers in his book. In DDD style, persistence layer is an implementation detail. <br />From Evan's book, i have used Bounded Contexs for maintain the domain model complexity controlled.<br /><br />When you design your domain model, you define all attributes for these classes or use the AR for this? <br />I am defining all atributes in my domain model, but it seems that have a duplication here. Despite, my domain model have different classes from my AR model.Unknownhttps://www.blogger.com/profile/14105605750521656944noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-30900025595791243102012-01-01T20:18:13.400+01:002012-01-01T20:18:13.400+01:00@Luiz
Great to hear that you also separate AR fro...@Luiz<br /><br />Great to hear that you also separate AR from the domain model!<br /><br />I need to refresh my knowledge about DDD. Did Evans suggest anything about synchronizing the object model with the persistence layer?<br /><br />I'm going to write more about my research, thanks for your comment - it's motivating me!<br /><br />@Frank<br /><br />Good to see that the backend/fronted is now getting obvious to many people. That alone will improve our architectures.<br /><br />As for clients, yeah, I know how it is :) However, our customers are smart people, it's just an art of explaining them which way works best in a short run and which is serving us better in the future. <br /><br />The nice thing is that a nice architecture is not a binary value. You can get closer it with every little refactoring step.<br /><br />@lukemh<br /><br />Uncle Bob rules :)<br /><br />There is a problem with terminology, as always.<br /><br />Interactors, services, contexts (DCI), habits (DCI), use-cases - they are all similar things.<br /><br />I call them use-cases, however often they mean habits. I still have Rails controllers, but they just delegate most of work to the use-case object, like AddToCartUseCase (it should be habit, really).<br /><br />Resources are at different level. Layer above. Delivery mechanism. cart#add sounds good to me, as is #cart_items/create<br /><br />@Pavel<br /><br />It's a mixture of different problems.<br />1. Using DCI at the level of ActiveRecord classes is wrong. We felt into this trap. DCI makes more sense at the OOP level. That's why I'm focusing so much about separating the two. One problem we've had was that, even though we extended some objects in "contexts", the same objects retrieved from AR again (without Identity Map) didn't have the roles. Thus the need for extending them again, deep in the models.<br /><br /><br />2. Extending should be at the context level. If you have domain/context objects (any example?) then it sounds good to extend it there.<br /><br />3. DCI without contexts/use-cases is useless. We were not disciplined enough to have contexts everywhere and problems appeared quickly.<br /><br />4. If not all of your team is truly convinced to DCI, then don't start with that. Even one person in a team who doesn't get DCI can make it very hard by using it in a wrong way. As with every "new" thing, it requires more education.Andrzej Krzywdahttps://www.blogger.com/profile/06399276063142826365noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-14862307669360372432012-01-01T11:53:19.593+01:002012-01-01T11:53:19.593+01:00Hello Andrzej,
thank you for the post.
The most ...Hello Andrzej,<br /><br />thank you for the post.<br /><br />The most interesting part for me - the lessons learned during your DCI-based rails project. You express a warning against "extending model objects inside other model objects". But the "Lean architecture" book describes hybrid Context-Domain objects and recommends to use them. Could you comment on these contradictions.Pavel Mitinhttps://www.blogger.com/profile/03323256413368409095noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-81959347947877669862012-01-01T02:27:04.663+01:002012-01-01T02:27:04.663+01:00Just wanted to thank you for the link to the Uncle...Just wanted to thank you for the link to the Uncle Bob talk from RubyMidwest . Was an awesome eye opener. I always thought there was a better way above MVC.<br /><br />Could you suggest how you would name your rails controllers when interacting with various 'Interactors'?<br /><br />I had an interactor called CreatesOrder and another that is called AddItemToOrder would you name your controller cart#add ?<br /><br />Thanks,<br /><br />Luke Holder<br />@lukeholderlukemhhttps://www.blogger.com/profile/10638321928759651697noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-16378694312571422552011-12-31T17:41:24.845+01:002011-12-31T17:41:24.845+01:00Andrzej, thank you for your post. Good software a...Andrzej, thank you for your post. Good software architecture is an art and a skill that takes time to learn and master without regards to the platform. Rails is certainly a great platform to work with. It is still up to the developers to make the right choices for their applications.<br /><br />I agree that the future is going back to client-server patterns with clean separation between presentation applications and the backend application.<br /><br />Its a lot easier to do in theory though than in practice. Especially when working on paid projects for clients who do not have a long term roadmap beyond launching their website or their app.<br /><br />Again, great post :-)Anonymoushttps://www.blogger.com/profile/13755808416062470819noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-1391197920844526982011-12-31T17:11:11.407+01:002011-12-31T17:11:11.407+01:00Great Post.
Currently, I'm working on some mo...Great Post. <br />Currently, I'm working on some more complex projects with rails. <br />In these projects I am using a technique very similar to this. <br />My domain model is completly separated from active record. I dont start from migrations.<br />I am starting to create my domain model with simple ruby objects (POROs) and using a Test Driven approach this<br />domain model emerges from use-case needs. This is a very efficient way to work for me. <br />The main problem with this way, as you said, is to mantain the AR layer and Domain Layer sync. <br />I have strongly used the advices from Eric Evans in his classic book 'Domain Driven Design". <br />My domain model is broken in contexts (Bounded Countexts) and this contexts touches with persistence layer using a repository abstraction.<br />It'i'm not sure if this is the best way, but it has worked for me in the last two projects, allowing the reuse part of a domain model between this projects.<br />I am very interested in this topic, and I would like to hear more from you about this"Luiz Costanoreply@blogger.com