Skip to content

Commit 4da9d82

Browse files
add a section about 'Scenes', see #88
1 parent 067a55c commit 4da9d82

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/phet-software-design-patterns.md

+12
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ For general information on many standard design patterns, see _[Learning JavaScr
1919
* [Namespace](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#namespace)
2020
* [Observer](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#observer) 🚧
2121
* [Options and Config](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#options-and-config)
22+
* [Scenes](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#scenes)
2223
* [Singleton](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#singleton)
2324
* [State Machine](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#state-machine)
2425
* [Strategy](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#strategy)
@@ -811,6 +812,17 @@ mindful of the option naming to make sure that you don't cause name collisions.
811812
Try to keep related options groups together, both for instantiation and `merge` statements. For examples, if you
812813
have several options related to a11y, keep them together, don't interleave them with other options.
813814

815+
### Scenes
816+
817+
Author: @jessegreenberg
818+
819+
A "Scene" in a PhET simulation is a collection of elements presented to the user. When a new scene is selected,
820+
elements of the previous scene will be swapped out for elements in the new scene. A single simulation Screen may have
821+
multiple Scenes. The implementation of a Scene should adhere to the [Model-View-Controller (MVC)](https://github.com/phetsims/phet-info/blob/master/doc/phet-software-design-patterns.md#model-view-controller-mvc)
822+
pattern and be implemented like any other component in a simulation. There is no base class called Scene which
823+
combines a SceneModel and a SceneView. Instead, model information for a Scene should exist with the rest of the
824+
simulation model and view code for a scene should exist with the rest of the simulation view code.
825+
814826
### Nesting
815827

816828
If using composition for your class, and you want to pass options into a subcomponent, you can nest

0 commit comments

Comments
 (0)