Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Nostromo wurde ursprünglich nach dem Prinzip Convention over Configuration entwickelt. Das bedeutet, dass Code einer bestimmten Konvention entsprechen muss. Tut er das, passiert vieles in Nostromo automatisch. Dieses Prinzip ermöglicht eine schnelle Entwicklung stellt aber neue Entwickler oft vor Probleme. Die Oberflächen werden komponentenbasiert entwickelt. Das bedeutet, dass die Oberflächen erstellt werden, indem PHP Objekte ineinander verschachtelt werden. Diese Baumstruktur wird erst ganz am Schluss der Pipeline in HTML gewandelt. Jedes Control ist dabei selbst für seine Wandlung verantwortlich. Dieses Vorgehen erlaubt eine hohe Wiederverwendbarkeit, sowie das automatische Generieren von Oberflächen. Allerdings ist man damit natürlich nicht so flexibel, wie wenn man den HTML Code direkt schreiben würde. Besondere Herausforderungen bestehen in der Einbettung von JavaScript. was developed when convention over configuration was the way to go. This means that as long as classes, directory structures and other things conform to a certain convention the framework will pick them up automatically. While this enables a very fast dev flow when you are used to the conventions, it slows down anyone that is not fluid with them, resulting in a quite steep learning curve. Over time explicit configuration came en vogue again, because it is easier to test as certain aspects of the application flow can be easier mocked during testing if you are able to overrule the default. As time went by both approaches mixed in Nostromo, which takes some getting used to which parts work by convention and when you have to configure stuff. We started to be more explicit and make more use of concepts like composition over inheritence, resulting in more explicit and concise code.

The UI is build in a component-based manner similar to how you build UIs for desktop applications (i.e. Swing). You build object trees that are only rendered to HTML at the very last moment before the output. This enables us to create UIs programmatically and have different output by using another rendering method for that object tree. It takes some getting used to, because you rarely see any HTML. In the long run we will probably switch to view models and use libraries like inertia.js to connect single page apps with our server side logic.