Persistence ignorance in Rails. ActiveRecord 6 and beyond!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Persistence ignorance in Rails. ActiveRecord 6 and beyond!

Laerti Papa
Hi guys,

thank you for your effort so far and for your contribution.  

I've been playing around with DDD concepts lately and trying to apply them to Rails. It's been super annoying and frustrating trying to fight the framework to apply them especially when it comes to **Persistence ignorance**. It would be nice if the framework supported that out of the box either with a DSL likeish framework or configuration files. Also to have a more safe typing approach regarding data attributes I have to either implement it myself or use existing libraries like dry-rb or something.   

I was curious why so many years we don't decouple active record into two pieces. One to keep it as is. Second, allow users to decouple entities and data access objects and have a framework that will support them in better domain modeling without having to write much-supporting code to do so. 

I would appreciate any thoughts.

Best
LP




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/ceacb4b5-1bea-41e3-9c2d-50abd6d23928%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Persistence ignorance in Rails. ActiveRecord 6 and beyond!

William T. Nelson
Building this capability into Rails would be contrary to the current project philosophy, so don't expect it soon.

However, Ryan Bigg has been working on similar features recently. See his reports here: https://ryanbigg.com/2020/02/rom-and-dry-showcase-part-1

On Monday, February 3, 2020 at 9:39:47 PM UTC-6, Laerti Papa wrote:
Hi guys,

thank you for your effort so far and for your contribution.  

I've been playing around with DDD concepts lately and trying to apply them to Rails. It's been super annoying and frustrating trying to fight the framework to apply them especially when it comes to **Persistence ignorance**. It would be nice if the framework supported that out of the box either with a DSL likeish framework or configuration files. Also to have a more safe typing approach regarding data attributes I have to either implement it myself or use existing libraries like dry-rb or something.   

I was curious why so many years we don't decouple active record into two pieces. One to keep it as is. Second, allow users to decouple entities and data access objects and have a framework that will support them in better domain modeling without having to write much-supporting code to do so. 

I would appreciate any thoughts.

Best
LP




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/3818255d-9f1c-420b-a507-30a9cf2caed0%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Persistence ignorance in Rails. ActiveRecord 6 and beyond!

Laerti Papa
Thank you for your reply, 

I understand that it is against the active record philosophy, it would be nice though to support both patterns and let the developer choose. I end up writing a lot of code every time I use AR only as the persistence on top of a repo instance. 


Thanks again.
LP


On Monday, February 10, 2020 at 4:24:11 AM UTC+1, William T. Nelson wrote:
Building this capability into Rails would be contrary to the current project philosophy, so don't expect it soon.

However, Ryan Bigg has been working on similar features recently. See his reports here: <a href="https://ryanbigg.com/2020/02/rom-and-dry-showcase-part-1" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fryanbigg.com%2F2020%2F02%2From-and-dry-showcase-part-1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHTxHl7ZLyAZGbQv1oeiajWoAICBQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fryanbigg.com%2F2020%2F02%2From-and-dry-showcase-part-1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHTxHl7ZLyAZGbQv1oeiajWoAICBQ&#39;;return true;">https://ryanbigg.com/2020/02/rom-and-dry-showcase-part-1

On Monday, February 3, 2020 at 9:39:47 PM UTC-6, Laerti Papa wrote:
Hi guys,

thank you for your effort so far and for your contribution.  

I've been playing around with DDD concepts lately and trying to apply them to Rails. It's been super annoying and frustrating trying to fight the framework to apply them especially when it comes to **Persistence ignorance**. It would be nice if the framework supported that out of the box either with a DSL likeish framework or configuration files. Also to have a more safe typing approach regarding data attributes I have to either implement it myself or use existing libraries like dry-rb or something.   

I was curious why so many years we don't decouple active record into two pieces. One to keep it as is. Second, allow users to decouple entities and data access objects and have a framework that will support them in better domain modeling without having to write much-supporting code to do so. 

I would appreciate any thoughts.

Best
LP




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/ec331d07-d81a-45eb-a9e8-eb43728be750%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Persistence ignorance in Rails. ActiveRecord 6 and beyond!

Pedro Fernandes Steimbruch
Just my two cents here.

Do not waste time trying to apply code concepts (factories, repositories, etc.) from the Eric Evans book, if you think you are DDD only by using those, you are doing it wrong.
DDD is much more about Crunching Knowledge, Ubiquitous Language, Bounded Contexts and converging these to express your domain on your model always evolving to a deeper insight.

DDD is about tackling complexity on your software. Isn't writing a lot of code just to implement *Persistence Ignorance* increasing the complexity of what you have?

Enjoy what ActiveRecord gives you in a healthy way.

On Mon, Feb 10, 2020 at 4:14 PM Laerti Papa <[hidden email]> wrote:
Thank you for your reply, 

I understand that it is against the active record philosophy, it would be nice though to support both patterns and let the developer choose. I end up writing a lot of code every time I use AR only as the persistence on top of a repo instance. 


Thanks again.
LP


On Monday, February 10, 2020 at 4:24:11 AM UTC+1, William T. Nelson wrote:
Building this capability into Rails would be contrary to the current project philosophy, so don't expect it soon.

However, Ryan Bigg has been working on similar features recently. See his reports here: https://ryanbigg.com/2020/02/rom-and-dry-showcase-part-1

On Monday, February 3, 2020 at 9:39:47 PM UTC-6, Laerti Papa wrote:
Hi guys,

thank you for your effort so far and for your contribution.  

I've been playing around with DDD concepts lately and trying to apply them to Rails. It's been super annoying and frustrating trying to fight the framework to apply them especially when it comes to **Persistence ignorance**. It would be nice if the framework supported that out of the box either with a DSL likeish framework or configuration files. Also to have a more safe typing approach regarding data attributes I have to either implement it myself or use existing libraries like dry-rb or something.   

I was curious why so many years we don't decouple active record into two pieces. One to keep it as is. Second, allow users to decouple entities and data access objects and have a framework that will support them in better domain modeling without having to write much-supporting code to do so. 

I would appreciate any thoughts.

Best
LP




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/ec331d07-d81a-45eb-a9e8-eb43728be750%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/CAA2Dq%2BMK5MK-tiYpvABbh%3DtV%3DVfdxkS9nhe-JwEWjmLitbWipg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Persistence ignorance in Rails. ActiveRecord 6 and beyond!

Kasper Timm Hansen
Well said, Pedro. I don’t think there’s much interest in adding the repository pattern to Active Record.

--
Kasper
On 18 Feb 2020, 15.28 +0100, Pedro Fernandes Steimbruch <[hidden email]>, wrote:
Just my two cents here.

Do not waste time trying to apply code concepts (factories, repositories, etc.) from the Eric Evans book, if you think you are DDD only by using those, you are doing it wrong.
DDD is much more about Crunching Knowledge, Ubiquitous Language, Bounded Contexts and converging these to express your domain on your model always evolving to a deeper insight.

DDD is about tackling complexity on your software. Isn't writing a lot of code just to implement *Persistence Ignorance* increasing the complexity of what you have?

Enjoy what ActiveRecord gives you in a healthy way.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/CAA2Dq%2BMK5MK-tiYpvABbh%3DtV%3DVfdxkS9nhe-JwEWjmLitbWipg%40mail.gmail.com.
On Mon, Feb 10, 2020 at 4:14 PM Laerti Papa <[hidden email]> wrote:
Thank you for your reply, 

I understand that it is against the active record philosophy, it would be nice though to support both patterns and let the developer choose. I end up writing a lot of code every time I use AR only as the persistence on top of a repo instance. 


Thanks again.
LP


On Monday, February 10, 2020 at 4:24:11 AM UTC+1, William T. Nelson wrote:
Building this capability into Rails would be contrary to the current project philosophy, so don't expect it soon.

However, Ryan Bigg has been working on similar features recently. See his reports here: https://ryanbigg.com/2020/02/rom-and-dry-showcase-part-1

On Monday, February 3, 2020 at 9:39:47 PM UTC-6, Laerti Papa wrote:
Hi guys,

thank you for your effort so far and for your contribution.  

I've been playing around with DDD concepts lately and trying to apply them to Rails. It's been super annoying and frustrating trying to fight the framework to apply them especially when it comes to **Persistence ignorance**. It would be nice if the framework supported that out of the box either with a DSL likeish framework or configuration files. Also to have a more safe typing approach regarding data attributes I have to either implement it myself or use existing libraries like dry-rb or something.   

I was curious why so many years we don't decouple active record into two pieces. One to keep it as is. Second, allow users to decouple entities and data access objects and have a framework that will support them in better domain modeling without having to write much-supporting code to do so. 

I would appreciate any thoughts.

Best
LP




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/ec331d07-d81a-45eb-a9e8-eb43728be750%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/bbfc9c27-098f-418f-9434-ba7d373a6429%40Spark.
Reply | Threaded
Open this post in threaded view
|

Re: Persistence ignorance in Rails. ActiveRecord 6 and beyond!

Laerti Papa
I don't think that using tactical patterns in DDD should be avoided. I agree that AR is awesome but expressing the domain when you involve persistence you have conflicts. As well said evolving your model should not affect my persistence layer. 

Thanks for the feedback both much appreciated.

Best
LP

On Tuesday, February 18, 2020 at 6:07:33 PM UTC+1, Kasper Timm Hansen wrote:
Well said, Pedro. I don’t think there’s much interest in adding the repository pattern to Active Record.

--
Kasper
On 18 Feb 2020, 15.28 +0100, Pedro Fernandes Steimbruch <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gZu8ysbwBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">pedrofst...@...>, wrote:
Just my two cents here.

Do not waste time trying to apply code concepts (factories, repositories, etc.) from the Eric Evans book, if you think you are DDD only by using those, you are doing it wrong.
DDD is much more about Crunching Knowledge, Ubiquitous Language, Bounded Contexts and converging these to express your domain on your model always evolving to a deeper insight.

DDD is about tackling complexity on your software. Isn't writing a lot of code just to implement *Persistence Ignorance* increasing the complexity of what you have?

Enjoy what ActiveRecord gives you in a healthy way.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gZu8ysbwBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-core/CAA2Dq%2BMK5MK-tiYpvABbh%3DtV%3DVfdxkS9nhe-JwEWjmLitbWipg%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/CAA2Dq%2BMK5MK-tiYpvABbh%3DtV%3DVfdxkS9nhe-JwEWjmLitbWipg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/CAA2Dq%2BMK5MK-tiYpvABbh%3DtV%3DVfdxkS9nhe-JwEWjmLitbWipg%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-core/CAA2Dq%2BMK5MK-tiYpvABbh%3DtV%3DVfdxkS9nhe-JwEWjmLitbWipg%40mail.gmail.com.
On Mon, Feb 10, 2020 at 4:14 PM Laerti Papa <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gZu8ysbwBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">laerti...@...> wrote:
Thank you for your reply, 

I understand that it is against the active record philosophy, it would be nice though to support both patterns and let the developer choose. I end up writing a lot of code every time I use AR only as the persistence on top of a repo instance. 


Thanks again.
LP


On Monday, February 10, 2020 at 4:24:11 AM UTC+1, William T. Nelson wrote:
Building this capability into Rails would be contrary to the current project philosophy, so don't expect it soon.

However, Ryan Bigg has been working on similar features recently. See his reports here: <a href="https://ryanbigg.com/2020/02/rom-and-dry-showcase-part-1" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fryanbigg.com%2F2020%2F02%2From-and-dry-showcase-part-1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHTxHl7ZLyAZGbQv1oeiajWoAICBQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fryanbigg.com%2F2020%2F02%2From-and-dry-showcase-part-1\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHTxHl7ZLyAZGbQv1oeiajWoAICBQ&#39;;return true;">https://ryanbigg.com/2020/02/rom-and-dry-showcase-part-1

On Monday, February 3, 2020 at 9:39:47 PM UTC-6, Laerti Papa wrote:
Hi guys,

thank you for your effort so far and for your contribution.  

I've been playing around with DDD concepts lately and trying to apply them to Rails. It's been super annoying and frustrating trying to fight the framework to apply them especially when it comes to **Persistence ignorance**. It would be nice if the framework supported that out of the box either with a DSL likeish framework or configuration files. Also to have a more safe typing approach regarding data attributes I have to either implement it myself or use existing libraries like dry-rb or something.   

I was curious why so many years we don't decouple active record into two pieces. One to keep it as is. Second, allow users to decouple entities and data access objects and have a framework that will support them in better domain modeling without having to write much-supporting code to do so. 

I would appreciate any thoughts.

Best
LP




--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gZu8ysbwBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-core/ec331d07-d81a-45eb-a9e8-eb43728be750%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/ec331d07-d81a-45eb-a9e8-eb43728be750%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-core/ec331d07-d81a-45eb-a9e8-eb43728be750%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-core/ec331d07-d81a-45eb-a9e8-eb43728be750%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/a27cb2b9-6115-445e-b12e-6858f67260a3%40googlegroups.com.