Re: dynamic loading and unloading of module

Robert Klemme <[email protected]> Mon, 19 Aug 2019 12:30:17 +0200
Newsgroups gmane.comp.lang.ruby.general
Message-ID <CAM9pMnMSWW8pYxZ5XxeuwbW2LPxnZpukrZCbmwLmPBEJ6MvfhA@mail.gmail.com>
On Sun, Aug 18, 2019 at 1:31 PM Chris Roerig <[email protected]> wrote:

> Hi. You can’t “remove” them but you can replace them by calling the
> factory again. My thought was to stuff the functionality needed into
> dedicated classes and swap that functionality as the need changes. That
> being said, it’s only one way to address the issue.
>

But note that the object needs to retain the state. That becomes awfully
complex with factory pattern because then you have to feed in the previous
object, replace references - basically it is not factory any more and the
handling becomes quite complex because you are not retaining object
identity - which, it seems to me, is required here. As said, I do not think
factory pattern is the right tool here.

Kind regards

robert

-- 
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can -
without end}
http://blog.rubybestpractices.com/


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>