Re: Statics and caches and mocks oh my!

David Burstin <[email protected]>
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <CAKKh91C2nhDeqCHCUUz2aJCT=eZSu5JMNKpDF1W2uSGw+30mpQ@mail.gmail.com>
As far as code smells go, some people just seem to have blocked noses!

Anyway, thanks everyone for your answers. I'm glad to see that I am on the
right track - now I just have to convince everyone else. I think the best
way forward is baby steps. I will start by encapsulating the statics inside
a concrete implementation with a well-defined interface. Even that might
take some convincing! But at least it will give the opportunity to do some
good testing.

I am looking at the possibility of using a DI framework to replace the
singleton caches, but that will be a HUGE leap for these guys. What do you
guys feel is the best strategy for caching without having to pass around an
entire collection of cache instances?


Cheers
David


On 27 June 2013 04:24, Steven Gordon <[email protected]> wrote:

>
>
> On Wed, Jun 26, 2013 at 10:54 AM, Michal Svoboda <[email protected]> wrote:
>
>> **
>>
>>
>> > Everyone else on the team thinks that they are a great solution.
>>
>> I hear you. It's not easy to convince others of their design problems
>> unless there is hard factual evidence. Look around the user code of that
>> object and you'll find the smells.
>>
>
> Or there might not be any convincing enough smells, yet!
>
> If not, bide your time, watch for smells as the code scales, and when
> convincing smells appear, then make the case for refactoring it away
> (trying not to say "I told you so").
>
> One benefit is that there may be more information later to indicate what
> the most appropriate alternative would be.
>
> SteveG
>
>
>>
>> Michal Svoboda
>>
>>  
>>
>
>


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/testdrivendevelopment/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.