Designing the FragmentedChemicalSystem Class
Note
At present the ChemicalSystem class is somewhat of a stub. When the
design of the ChemicalSystem class evolves the design of the
FragmentedChemicalSystem class will evolve too.
This page describes the design of the FragmentedChemicalSystem class.
Why Do We Need the FragmentedChemicalSystem Class?
Like the FragmentedNuclei and FragmentedMolecule classes, the need for
the FragmentedChemicalSystem class was motivated by the
chemical system hierarchy consideration raised in
Designing the Fragmenting Component. In short, fragmenting a
ChemicalSystem class requires us to fragment each layer of the hierarchy.
The FragmentedChemicalSystem class is responsible for fragmenting the
ChemicalSystem part.
FragmentedChemicalSystem Considerations
- chemical system state
The
FragmentedChemicalSystemclass must act like it contains a series ofChemicalSystemobjects. This requires it to hold aFragmentedMoleculeand eventually a set of fields (fields are currently an experimental feature and this will need modified).
- chemical system compatible
The fragments in a
FragmentedChemicalSystemare expected to be usable whereverChemicalSystemobjects can be used.
FragmentedChemcialSystem APIs
To construct a FragmentedChemicalSystem:
// It's assumed that the user already has a ChemicalSystem object
ChemicalSystem chem_sys = make_a_chemical_system();
FragmentedChemicalSystem empty; // See FragmentedBase for more details
FragmentedChemicalSystem empty(chem_sys);
//If you already have a FragmentedMolecule
FragmentedMolecule frags = make_fragments();
FragmentedChemicalSystem has_frags(frags);
Some notes on the above:
make_a_chemical_systemandmake_fragmentsare opaque functions which respectively encapsulate the details of creatingChemicalSystemandFragmentedMoleculeobjects respectively. The details of these functions are irrelevant for the purposes of this discussion.
FragmentedChemicalSystem Design
Fig. 14 State of the FragmentedChemicalSystem class and its relationship to
related classes.
Fig. 14 shows the design of the
FragmentedChemicalSystem class. At present the class is just a thin wrapper
around a FragmentedMolecule object. Eventually we foresee the state
expanding in accordance with the chemical system state consideration.
To address the chemical system compatible consideration the
fragments will be returned as ChemicalSystemView objects.
Summary
- chemical system state
Right now
FragmentedChemicalSystemis a thin wrapper around aFragmentedMoleculeobject. In the future it will need to be extended to fields.- chemical system compatible
Fragments in the
FragmentedChemicalSystemclass are returned as