﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Jesse commented on Active vs. Passive code bases</title><description>TIL: Ayende is apparently secretly working at my place of employ. (o_O)

Seriously, this is an example of the code base I recently got thrust into. It truly is a pain to deal with, and trying to clean it up is even more so.</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment16</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment16</guid><pubDate>Fri, 04 Jan 2013 18:54:25 GMT</pubDate></item><item><title>Ayende Rahien commented on Active vs. Passive code bases</title><description>Jason,
I would strongly disagree here, see my next post for details</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment15</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment15</guid><pubDate>Fri, 04 Jan 2013 13:37:54 GMT</pubDate></item><item><title>Jason Folkens commented on Active vs. Passive code bases</title><description>When people combine methods and data into a class in a way such that you are recommending, I wonder if they truly value the single responsability principle.   In my mind, storing both schema and behavior in the same class qualifies as a violation of the SRP.  Do you disagree with me that this is a 'violation', or do you just not think the SRP is important?</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment14</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment14</guid><pubDate>Fri, 04 Jan 2013 13:09:52 GMT</pubDate></item><item><title>Ayende Rahien commented on Active vs. Passive code bases</title><description>Laoujin,
I think you miss an important point. What I want to do is to store the _entire validator_ in the db.
Not just the data for that. </description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment13</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment13</guid><pubDate>Fri, 04 Jan 2013 08:53:53 GMT</pubDate></item><item><title>Laoujin commented on Active vs. Passive code bases</title><description>In some companies having to redeploy could be a full days work, while doing a database update might be an hours work (paperwork, ...). This, among others, might be the reason to use 

Switch statements (or excessive use of them anyway) are usually bad in OO design but it's not the Type/Value table in the database that is at fault here!
You can define AvoidCurseWordsValidator but simply get the list of curse words out of the database.

Because in the end, you will need to set the AvoidCurseWordsValidator.CurseWords property. You still need to inject those form somewhere. A database sounds like a legit option to me here...</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment12</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment12</guid><pubDate>Fri, 04 Jan 2013 08:48:29 GMT</pubDate></item><item><title>Ashok Guduru commented on Active vs. Passive code bases</title><description>Does Value Object (VO) pattern do a better job than this data-driven/ validations style?</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment11</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment11</guid><pubDate>Fri, 04 Jan 2013 05:55:01 GMT</pubDate></item><item><title>Daniel Lang commented on Active vs. Passive code bases</title><description>@Giedrius, you mentioned Magento as a example why EAV models in relational databases are good. This is completely wrong. I work with Magento on a day to day basis and every single developer I've met has complained about Magento being so slow. The top reason for that is EAV, so Magento 2.0 that is announced to go stable later this year will break with EAV at a lot of different parts. So when the most popular eCommerce system in the world decides to go away from EAV because it's slowless, I don't think this is a good point for that pattern.

eCommerce systems could be so much more powerful if they'd use a document database like RavenDB but unfortunately that news hasn't yet arrived at the PHP/MySQL crowd.</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment10</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment10</guid><pubDate>Thu, 03 Jan 2013 19:35:43 GMT</pubDate></item><item><title>Ayende Rahien commented on Active vs. Passive code bases</title><description>Dan,
THANKS YOU, So many comments and you are the first to comment on that.</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment9</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment9</guid><pubDate>Thu, 03 Jan 2013 17:20:21 GMT</pubDate></item><item><title>Dan commented on Active vs. Passive code bases</title><description>Dat teddy bear.. haha!

But yea, I agree with this post.  In my experience the 'passive' style just causes unnecessary confusion as you waste time and mental energy searching for which data object is related to which consuming class, yea, loosely coupled but for what reason?</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment8</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment8</guid><pubDate>Thu, 03 Jan 2013 17:19:17 GMT</pubDate></item><item><title>João P. Bragança commented on Active vs. Passive code bases</title><description>@Matt,

If I had a nickel every time I heard 'you should be able to change ? just put it in ?.config!' and the justification is always 'the business shouldn't have to go to a developer everytime that blah.'

Of course said systems eventually become un-maintainable.</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment7</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment7</guid><pubDate>Thu, 03 Jan 2013 16:13:34 GMT</pubDate></item><item><title>Matt McElheny commented on Active vs. Passive code bases</title><description>I think a lot of this design pattern comes from a requirement (either real or just perceived) to be able to change or fix the functionality of an application live without having to re-compile code and redeploy.  Sometimes it's necessary, and sometimes it's not, but there's no silver bullet - just trade-offs to different approaches.  I think this is one of the main reasons stored procedures (shudder) continue to live on.</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment6</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment6</guid><pubDate>Thu, 03 Jan 2013 16:05:29 GMT</pubDate></item><item><title>Duckie commented on Active vs. Passive code bases</title><description>In a document database you would have the attributes and values embedded in the document itself, and not in a seperate document / table as done in a relational database.</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment5</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment5</guid><pubDate>Thu, 03 Jan 2013 13:30:55 GMT</pubDate></item><item><title>Giedrius commented on Active vs. Passive code bases</title><description>@Remi, could you explain why it is a huge mistake in a schema less database? Because out of context, but Ayende's first sentence below kind of says opposite, but then later it kind of correlates with what you are saying, so I think I'm missing the binding piece here to have "aha" moment.

From: Oren Eini
Date: 29 February 2012 17:04
Subject: Re: RavenDB and EAV
To: Giedrius


Oh, no. RavenDB is awesome for EAV.
The schema less nature fits RavenDB very nicely. You can have different properties for different docs, different properties for different docs of the same type, etc.

You can search and work with that effectively.

It is a really sweet spot for that.


On Wed, Feb 29, 2012 at 5:02 PM, Giedrius Banaitis wrote:
Hi,
I'm wondering if EAV (http://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model) is as bad in RavenDB as in relational database based solutions, or RavenDB is well suited for such problem approach (if you need more concrete domain to answer - products and their attributes)? 

Giedrius
</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment4</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment4</guid><pubDate>Thu, 03 Jan 2013 13:05:15 GMT</pubDate></item><item><title>Rémi BOURGAREL commented on Active vs. Passive code bases</title><description>EAV may be interesting (event though I strongly hate it) in relational database, but it's a huge mistake in a schema-less database. </description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment3</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment3</guid><pubDate>Thu, 03 Jan 2013 12:56:53 GMT</pubDate></item><item><title>Giedrius commented on Active vs. Passive code bases</title><description>It looks like they are using EAV model, which is bad when used in wrong place, but in some cases it does its job. Take for example magento e-shop - it uses eav a lot (was using even more before) and it is popular, because it is flexible and does it job, it scarifies performance over flexibility. 
</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment2</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment2</guid><pubDate>Thu, 03 Jan 2013 10:53:30 GMT</pubDate></item><item><title>Whut commented on Active vs. Passive code bases</title><description>Data driven development is still very popular, even though object orientation was invented decades ago:)</description><link>http://ayende.com/160514/active-vs-passive-code-bases#comment1</link><guid>http://ayende.com/160514/active-vs-passive-code-bases#comment1</guid><pubDate>Thu, 03 Jan 2013 10:08:31 GMT</pubDate></item></channel></rss>