arachne-framework / arachne-core

The core module for the Arachne web framework
Other
165 stars 13 forks source link

Weavejester's Integrant instead of SierraComponent #41

Open rastandy opened 7 years ago

rastandy commented 7 years ago

It seems to me that Integrant is more suited for Arachne rather than SierraComponents in respect to defining as much as possible a system through data.

As the Project's rationale says: "In Component, systems are created programmatically. Constructor functions are used to build records, which are then assembled into systems. In Integrant, systems are created from a configuration data structure, typically loaded from an edn resource. The architecture of the application is defined through data, rather than code."

This is inspired by Arachne, as the author explicitly says.

What I see more headed towards this objective of data described systems, is the way "constructors" are defined in Integrant.

In the configuration space, components are just keywords. You don't need to reference a constructor function in the configuration db.

Then, in code, Integrant allows you to implement a multimethod on the key from the configuration and then return an implementation of that component.

What do you think about this?

aadrian commented 7 years ago

+1

iku000888 commented 7 years ago

I'm just going to throw my own opinion in there.

The choice made in the alpha version of Arachne is to

  1. Store all configuration into a central Database,
  2. And then programatically assemble the system out of SierraComponents based on the info stored in the Database

Where as integrant somewhat handles the two phases together without a central Database.

The benefit of arache having a Full fledged DB at its core is that, powerful datalog expressions can be used to obtain information from the DB/add info to the db, which gives arachne modules a ton of leverage.

On the other-hand, I think integrant is limited in terms of how the parts of the application can know about the entire application. (Yes, there is the #ig/ref to point to other components, but a full db gives you cross entity joins etc for free which implies a module can have a deeper understanding of how the system is configured).

In conclusion, I do not think switching to integrant is worth it because 1. So many modules have been built on top of the current approach. 2. The actual benefit of switching to integrant is limited.

Plus, James is already committed to evolving duct into an integrant based framework, so I think if people who do not agree with the SierraComponent based approach have a resort.