llethub / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

Refactor PNode to break out some responsibilities. #121

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Piccolo2D's Monolithic design is great but when it comes to aspects of 
PNode's implementation that don't relate to the scene, it seems like they 
could be broken out in some way without complicating things too greatly.

One example is PNode's print method. It doesn't specifically relate to 
rendering the scene and it strikes me as something that could broken out 
into another class (maybe PNodePrinter).

Another example is toImage, it has so many overloads that it's becoming 
ridiculous. Considering that rendering a Node is something that's already 
handled by PCamera. I can't help but think that this logic is something 
that should be handled outside of PNode.

I'm not suggesting any particular fix, just mentioning something that 
should be discussed when we get started on v2.0.

Original issue reported on code.google.com by allain.lalonde on 5 Aug 2009 at 3:38

GoogleCodeExporter commented 9 years ago
I agree, toImage and print functionality seem like good candidates for 
extracting out
into instances of the Strategy pattern.

Original comment by heue...@gmail.com on 6 Aug 2009 at 4:04

GoogleCodeExporter commented 9 years ago
Couldn't they even be completely removed from PNode and rather be decorators to 
PNode
leveraging POffscreenCanvas?

Original comment by mr0...@mro.name on 6 Aug 2009 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by heue...@gmail.com on 26 Nov 2013 at 9:11