GithubHelp home page GithubHelp logo

bernlewal / fhtw-bif4-swen2-medialib Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 18 KB

Demo-Project for BIF4-SWEN2 in Java, showing Main- and Sub-FXML files, Main- and Sub-ViewModels, FXMLInjection and Module Based Project implementation

License: MIT License

Java 100.00%

fhtw-bif4-swen2-medialib's Introduction

Media-Library Sample

Demo-Project for BIF4-SWEN2 in Java.

Shows:

  • Main- and Sub-FXML files
  • Main- and Sub-ViewModels
  • FXMLInjection
  • Module Based Project implementation

Best Practices

  1. Split „big“ FXML-files into a MainWindow.fxml including sub-FXML-files using fx:include directive
  • Code organization / maintainability
  • Code-reusage
  1. One ViewModel-class („Sub-ViewModel“) per FXML-file
  2. Use dependency-injection to create controllers and viewmodels

FXML Dependency Injection

  • Dependency Injection Strategies:
    • Constructor injection
    • Field injection
  • --> Inversion of control
  • Prepare the FXMLLoader to populate Controllers by itself
  • Use a ControllerFactory
  • The ControllerFactory will connect the Controllers with the corresponding ViewModels

see https://edencoding.com/dependency-injection/

Module-based Projects with Maven

Hint 1: Multi-module projects

When generating (or changing to a) a multi-module project you need to run mvn clean install in order to update the internal maven-repo of all modules. Otherwise it may not find the artifacts of other modules. see (https://books.sonatype.com/mvnex-book/reference/multimodule-sect-intro.html)

Hint 2: Module dependencies

Don't place java-sources in the parent-project which depends on some of the child modules, because the parent-project is always build at first!
Instead create for this code an own child-module.

The build order of the modules is automatically detected by Maven regarding to the module dependencies.

fhtw-bif4-swen2-medialib's People

Contributors

bernlewal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.