com.rmc.rmc-umvcs

1.6.1 • Public • Published

npm package License: MIT

RMC

Rivello Multimedia Consulting has multiple frameworks for MVC in Unity.

-- Requires MonoBehaviour? Lightweight? More Info Created Updated
uMVCS ✔️ ✔️ (Light) See Below 2018 2023
Mini MVCS ✔️ (Even Lighter!) rmc-mini-mvcs 2023 2023

UMVCS

The UMVCS library for Unity is a custom framework embracing the MVCS architecture.

MVCS is one of many solutions for organizing a Unity projec efficiently. It may or may not be the best solution for you.

UMVCS MVCS Is Light

The UMVCS library a solution for MVCS architecture within Unity. It is heavily-dependent on MonoBehaviour as a It has no dependencies on 3rd party libraries.

UMVCS Is Free

The UMVCS MVCS library for Unity Development is free. Created by Rivello Multimedia Consulting.

UMVCS Is Simple & Proven

UMVCS is Flexible

It has few classes and a flexible pattern. Following the conventions of MVCS requires discipline as the system is purposefully light and flexible. For example the a model instance can access another model instance, but it is recommended not to do so.

UMVCS Best Practices

Communication

UMVCS is flexible and does not prevent actor-actor communication. However, best practices are to limit communication.

Communication Channels

  • Methods - The caller scope has a reference to the called scope and "calls a method" in the typical sense. This is the most coupled communication channel
  • Events - Observer pattern where the reciever has a reference to the sender
  • Commands - Observer pattern where the reciever has no reference to the sender. This is the least coupled communication channel

Communication Suggestions

-- To Model To View To Controller To Service
From Model ✔️(Events)
From View ✔️(Events)
From Controller ✔️(Methods) ✔️(Methods/Commands) ✔️(Commands) ✔️(Methods)
From Service ✔️(Events)

Communication Diagram

UMVCS Appropriateness

MVCS is one of many solutions for organizing a Unity projec efficiently. It may or may not be the best solution for you.

MVCS Pros MVCS Cons
Code is highly maintainable Code is highly repetitive
Code is highly extensible Project navigation requires more time
Faster to update an existing project Slower To start a new project
Adding a new feature is prescriptive Adding a new feature may require more classes
Faster learning curve to onboard veterans Slower learning curve to onboard newbies
Suggested for projects of medium/large scope Not Suggested for projects of small scope
Model is highly testable (TDD)
Coding invites less debate Coding requires more discipline

Appropriateness For Games

For projects where runtime optimization is essential, coding directly (without MVCS), may yield better performance.

However, that is likely a subsection of a game. The rest of the game may still benefit from MVCS. There is indeed flexibility for such a hybrid solution.

RMC UMVCS

How to use

The UMVCS library for Unity is a custom framework embracing the MVCS architecture.

MVCS is one of many solutions for organizing a Unity projec efficiently. It may or may not be the best solution for you. Enjoy!

Install

Via NPM

You can either use the Unity Package Manager Window (UPM) or directly edit the manifest file. The result will be the same.

UPM

To use the Package Manager Window, first add a Scoped Registry, then click on the interface menu ( Status Bar → (+) Icon → Add Package By Name ... ).

Manifest File

Or to edit the Packages/manifest.json directly with your favorite text editor, add a scoped registry then the following line(s) to dependencies block:

{
  "scopedRegistries": [
    {
      "name": "npmjs",
      "url": "https://registry.npmjs.org/",
      "scopes": [
        "com.rmc"
      ]
    }
  ],
  "dependencies": {
    "com.rmc.rmc-umvcs": "1.5.6"
  }
}

Package should now appear in package manager.

Via Git URL

You can either use the Unity Package Manager (UPM) Window or directly edit the manifest file. The result will be the same.

UPM

To use the Package Manager Window click on the interface menu ( Status Bar → (+) Icon → Add Package From Git Url ... ).

Manifest File

Or to edit the Packages/manifest.json directly with your favorite text editor, add following line(s) to the dependencies block:

{
  "dependencies": {
      "com.rmc.rmc-umvcs": "https://github.com/SamuelAsherRivello/rmc-umvcs.git"
  }
}

Tests

The package can optionally be set as testable. In practice this means that tests in the package will be visible in the Unity Test Runner.

Open Packages/manifest.json with your favorite text editor. Add following line after the dependencies block:

{
  "dependencies": {
  },
  "testables": [ "com.rmc.rmc-umvcs" ]
}

Samples

Some packages include optional samples with clear use cases. To import and run the samples:

  1. Open Unity
  2. Complete the package installation (See above)
  3. Open the Package Manager Window
  4. Select this package
  5. Select samples
  6. Import

Configuration

Created By

  • Samuel Asher Rivello
  • Over 23 years XP with game development (2023)
  • Over 10 years XP with Unity (2023)

Contact

License

Provided as-is under MIT License | Copyright © 2023 Rivello Multimedia Consulting, LLC

Package Sidebar

Install

npm i com.rmc.rmc-umvcs

Weekly Downloads

29

Version

1.6.1

License

MIT

Unpacked Size

258 kB

Total Files

140

Last publish

Collaborators

  • srivello