Menu
  • HOME
  • TAGS

Is skipping “accept” where type is known, a valid optimization for the Visitor pattern?

java,visitor,visitor-pattern,code-design

Visitor is just a complicated scaffold to implement double-dispatch on languages like Java. When you deal with leaf types, you don't need double-dispatch; the runtime type is known at the compile time. Dispatch a leaf type directly is not only an optimization, it's more out of principle. Of course, the...

Design pattern for incremental code

java,design-patterns,code-design

I think this is called pipeline: http://en.wikipedia.org/wiki/Pipeline_%28software%29 This pattern is used for algorithms in which data flows through a sequence of tasks or stages. You can search for a library that does this( http://code.google.com/p/pipelinepattern ) or try your own java implementation Basically you have all you objects in a list...

Requiring same module in multiple files

javascript,node.js,express,code-design,code-structure

From the node.js documentation: Modules are cached after the first time they are loaded. This means (among other things) that every call to require('foo') will get exactly the same object returned, if it would resolve to the same file. Multiple calls to require('foo') may not cause the module code to...

prevent unassigned objects, any reason this is a bad design consideration?

c#,wpf,resharper,code-design

To keep this simplified in coding, I put a "ShowDialog()" call at the end of the constructor of the form being displayed. That sounds like an ugly design to me, personally. Constructors are designed to return a usable object - and ideally that's all they should do. I would...

C# Code design / Seperate classes for each TabControl

c#,oop,architecture,software-design,code-design

Place a UserControl on each tab.