<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Are added parameters in a child class bad form?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/046f7006f5/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/046f7006f5/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/046f7006f5/</id><updated>2021-09-01T15:21:25.229000Z</updated><subtitle>Recent posts to Are added parameters in a child class bad form?</subtitle><entry><title>Are added parameters in a child class bad form?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/046f7006f5/?limit=25#44a4" rel="alternate"/><published>2021-09-01T15:21:25.229000Z</published><updated>2021-09-01T15:21:25.229000Z</updated><author><name>sean-barton</name><uri>https://forge.codesys.com/u/sean-barton/</uri></author><id>https://forge.codesys.com30f3bf245d6e1c95a78de79ec5c7a6e24ff04535</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a list of Ingredients where each Ingredient contains a structure of variables.&lt;/p&gt;
&lt;p&gt;The structure of variables is common to all Ingredients; however, occasionally an Ingredient will have a unique variable, in which case the variable is not in the structure but defined as a class variable.&lt;/p&gt;
&lt;p&gt;I have separated the Ingredients into classes, 'Ingredient' being the base class and other derived classes with unique parameters and overridden methods.&lt;/p&gt;
&lt;p&gt;When I create a list of Ingredients, only the structure of variables is passed to the list, and child ingredients extra parameters are lost.&lt;/p&gt;
&lt;p&gt;I cannot create a list of Ingredient interfaces because of the way the system persists objects - only instantiated objects may be persisted (stored to file).&lt;/p&gt;
&lt;p&gt;Do I just add the parameters of the child class to the structure of variables even though the parameter won't be used in most cases? This seems 'clunky' to me, but I can't seem to think of another way to save the parameter data. I'm trying to make this as object oriented as I can.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>