tag:blogger.com,1999:blog-7821856652257554779.post7940958876977486693..comments2023-10-22T12:47:47.534+02:00Comments on Andrzej on Software: DCI and Rails, lessons learntAndrzej Krzywdahttp://www.blogger.com/profile/06399276063142826365noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-7821856652257554779.post-59278590275680580052012-01-10T16:07:11.749+01:002012-01-10T16:07:11.749+01:00i would like to see more practical examples of usi...i would like to see more practical examples of using DCIkyktommyhttps://www.blogger.com/profile/02971031427372791862noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-38236492204530230722012-01-03T00:25:17.830+01:002012-01-03T00:25:17.830+01:00@Pavel
When I experimented with DCI inside AR obj...@Pavel<br /><br />When I experimented with DCI inside AR objects I went with the second way. It felt better that the first way, but it was still "wrong" because the roles included the associations at the class level, not at the object level (just a limitation of ActiveRecord that I was not able to work around).<br /><br />If I had to do DCI within AR, then I would do it this way again. There is however some hope in Rails 4, where ActiveRecord can be a module/role. It will make it better, but you should keep in mind that ActiveRecord should not dictate your OOP design and that would still be the case here.Andrzej Krzywdahttps://www.blogger.com/profile/06399276063142826365noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-90841059192046355912012-01-02T09:21:45.321+01:002012-01-02T09:21:45.321+01:00I am sure, we'll see a lot of DCI-based rails ...I am sure, we'll see a lot of DCI-based rails projects in the near future. But at the moment lessons learned during a real production project are very valuable. Thank you for sharing your findings.<br /><br />Question: How do you implement associations between objects/roles. I understand, that the answer depends on whether activerecord objects moved to the separate persistent layer or not. So, please elaborate both variants. To clarify my question, I would "guess" :) a few possible answers, assuming activerecord objects are used as domain objects:<br />1) An activerecord class uses "out of the box" associations (belongs_to, has_many...). The class contains all associations, what are needed for roles, depended on the class.<br />2) The activerecord class doesn't declare associations at all (although it may contain foreign keys). Roles declare associations.<br /><br />Thanks in advance.Pavel Mitinhttps://www.blogger.com/profile/03323256413368409095noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-89964768731736922852012-01-01T22:10:29.213+01:002012-01-01T22:10:29.213+01:00My last post touches this topic of domain/persiste...My last post touches this topic of domain/persistence:<br /><br />http://andrzejonsoftware.blogspot.com/2011/12/rails-is-still-cool.html<br /><br />I'm going to write more about it soon.Andrzej Krzywdahttps://www.blogger.com/profile/06399276063142826365noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-8861933593573655592012-01-01T21:07:01.799+01:002012-01-01T21:07:01.799+01:00Really interesting post, I'd love to know more...Really interesting post, I'd love to know more about how you play with AR and separate it from the actors and roles.Oriolhttps://www.blogger.com/profile/07389159498896425129noreply@blogger.com