Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xml Transformation Inheritaance #4529

Closed
scabug opened this issue Apr 29, 2011 · 3 comments
Closed

Xml Transformation Inheritaance #4529

scabug opened this issue Apr 29, 2011 · 3 comments

Comments

@scabug
Copy link

scabug commented Apr 29, 2011

at package scala.xml.transform you've got 3 classes

abstract class BasicTransformer extends Function1[Node,Node]
class RuleTransformer extends BasicTransformer
class RewriteRule extends BasicTransformer 

I think you can make RewriteRule as separate abstract class, because it is inheritance isn't necessary and overcomplicate code.

@scabug
Copy link
Author

scabug commented Apr 29, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4529?orig=1
Reporter: Alex Kolonitsky (alex.kolonitsky)

@scabug
Copy link
Author

scabug commented May 30, 2011

@dcsobral said:
Both RuleTransformer and RewriteRule depend on the basic engine of def transform(ns: Seq[Node]): Seq[Node]. Perhaps a better question is why have a RuleTransformer at all. The only thing it does different is not recursing on descendants inside def transform(n: Node): Seq[Node], which makes it possible to make an inheritance chain from RuleTransformer, and know it will stop at the identity implementation on RuleTransformer.

Since RuleTransformer does use the recursing characteristic of BasicTransformer, the safety net provided by RuleTransformer provides a certain guarantee of avoiding exponential explosions.

So, overall, I don't think breaking the inheritance here would make things easier instead of harder.

@scabug
Copy link
Author

scabug commented Jul 17, 2015

@SethTisue said:
The scala-xml library is now community-maintained. Issues with it are now tracked at https://github.com/scala/scala-xml/issues instead of here in the Scala JIRA.

Interested community members: if you consider this issue significant, feel free to open a new issue for it on GitHub, with links in both directions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant