rspec/rules/S1446/flex/rule.adoc

29 lines
688 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
A dynamic class defines an object that can be altered at run time by adding or changing properties and methods. This extremely powerful mechanism should be used very carefully, and only in very limited use cases.
Indeed, by definition dynamic classes make refactoring difficult and prevent the compiler from raising potential errors at compile time.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
dynamic public class DynamicFoo
{...}
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
public class Foo //Note that the class has been renamed to avoid confusion
{...}
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::rspecator-view[]