addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Re: [ljc] Visitor Pattern

From: Abraham Marín P.
Sent on: Friday, February 1, 2013 9:36 AM

Abraham Marín Pérez

Twitter: @AbrahamMarin

Sent from my iPhone

On 1 Feb 2013, at 07:14, Richard Gomes <[address removed]> wrote:

Hello Abraham,

Thanks a lot for your suggestion. I will work on that.

I'd say that a good question would be "how you can add functionality without changing the code"? I think it's a win. The ability to do that means that you are not introducing bugs on existing code, you don't have maintenance costs associated to code which already works well. This sort of benefit does not apply always and everywhere, but when applies, it is a win!

That argument, although not necessarily invalid, could be a bit tricky for a couple of reasons:

1. You may not add bugs to existing code, but that doesn't mean you don't add it to the new code. In fact, people could argue that by forcing the separation of code and computation the bug is more likely to happen due to the extra complexity. Plus, assuming your existing code already has an appropriate test bed, bugs would be mostly noticed.

2. The practice of not changing existing code but rather adding new functionality by "surrounding" the existing one is what lead to deteriorating code that became unmanageable in the past. That is not to say that doing it right could be the best thing to do in some scenarios, but depending on how you phrase it some people may complain

Hope that helps, looking forward to reading your articles.


But there's no free lunch in life: there's always a price to be paid...  and it is complexity in this case.
Things are complex until you understand them, or until you reorganize concepts inside your head and document them.
If you have people willing to read the documentation and explore what it evolves, they will ultimately understand what is going on, almost certainly.
So, I think that things remain complex/obscure only to people not willing to invest time/effort on them, for whatever reasons they have, which I definitely respect, by the way.

Cheers :)

Richard Gomes

On 31/01/13 10:49, Abraham Marín Pérez wrote:
Hi Richard,

I like the idea of having a good explanation about the visitor pattern, because I must admit when I first heard about how to separate data structure from algorithm my reaction was "isn't that exactly the opposite of what we intend to do with OOP?" 

If you'd like to split I'd suggest two articles: the first one presenting the problem, ie the situation in which you need to separate data and code, and the second explaining the pattern as a solution.


Abraham Marín Pérez

Twitter: @AbrahamMarin

Sent from my iPhone

On 30 Jan 2013, at 20:41, Richard Gomes <[address removed]> wrote:

This message exceeded the Maximum Message Size set in Account Settings, so we have only downloaded the first few lines from the mail server.

Download the rest of the message.

Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Richard Gomes ([address removed]) from LJC - London Java Community.
To learn more about Richard Gomes, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

Our Sponsors

  • Our Blog

    Read the latest news from the LJC

  • RecWorks Ltd

    Fixing Tech Recruitment using the Power of Community

  • jClarity

    Java/JVM Performance Analysis Tools & mentoring for Java related matters

  • LJC Aggrity

    Our LJC Aggrity site contains blog posts from our members

  • LJC Book Club

    Our Book club with book reviews from our members

  • Devoxx UK

    Java Community Conference in collaboration with the LJC, 8-10th June 16

  • SkillsMatter

    "Host, help organise, promote, film many of our meetings."

  • IBM

    Build Enterprise-grade apps at start-up speed.

  • New Relic

    New Relic makes sense of billions of metrics a day in real time.

  • Hazelcast

    Hazelcast is the leader in operating in-memory computing.

  • Java.Net

    We are an official Java User Group recognised by Oracle's JUG program

  • JRebel

    Free 3 month J-Rebel license.

  • O'Reilly

    40% discount on printed books and 50% on e-books.

  • Craft Rebellion

    Your choice of fresh craft beer, delivered. For 10% off use ‘LJC'

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy