Minerva – A brief history of the little framework that could – Minerva



Minerva – A brief history of the little framework that could – Minerva

0 0


minerva-slides


On Github joshknutson / minerva-slides

Minerva

A brief history of the little framework that could

Josh Knutson

  • Software Developer 3
  • @ Imagtrend for 8+ years
  • Working in CF, JS, CSS, and some .NET

Minerva

Roman name of Greek goddess Athena -Goddess of wisdom, crafts, and other stuff Township in NW Minnesota by Bemidji

What is Minerva

History

  • Started in 2009
  • over 100 authors have contributed
  • Convention based

Known Projects using Minerva

  • Cornerstone(sold)
  • Maverick/Firstcomp(sold)
  • Patient Registry
  • Cat Auctions
  • PAR
  • Licensure
  • Service Bridge
  • Service Bridge
  • Resource Bridge
  • Clickcomplete/Crow River Winery
  • Medtronic
  • ReportWriter
  • Others I forgot....

Architecture

  • Service Oriented Architecture
  • Model-View-Controller design pattern

Coldspring

  • Open source dependency injection framework for ColdFusion
    • Based off the Spring framework for Java
    • Manages components (CFCs)
  • http://www.coldspringframework.org/

Helpers Scope

  • Utility components used for common methods
    • Managing scoped data (request, session)
    • Displaying form fields
    • Formatting data
    • Accessing config settings
  • Created by ColdSpring post-processor
    • HelpersScopePostProcessor.cfc
  • Available to all singleton beans and views

Helpers Bean Definition

<bean id="helpers"
	 class="minerva.utils.beans.factory.HelpersScopePostProcessor"
	 bean-post-processor="true">
	 <property name="directories">
		  <list>
			   <value>/trauma/app/helpers/</value>
			   <value>/minerva/app/helpers/</value>
		  </list>
	 </property>
</bean>

Beans Scope

  • Annotation-based autowiring
  • <cfcomponent beans="userService">
  • Created by ColdSpring post-processor
    • BeansScopePostProcessor.cfc
  • Helps keep ColdSpring XML small
  • Available inside all singleton beans

Base Components

  • Contain core functionality
  • Project components should extend base components

Other Goodies

  • Parent environments in environment.xml that can inherit for faster setup of new environments
  • Packages in AssetManager
  • Display helpers using permissions
  • XML based managers
    • AccessManager
    • ActionManager
    • ActivityManager
    • AlertManager

Convenience Methods

  • minerva.base.Component
    • getBean()
    • getBeans()
    • containsBean()
    • getBeanFactory()
  • minerva.base.View
    • getValue()
    • setValue()
    • hasValues()
    • getValues()

Custom Tags

Tags to call display helpers but look more like html
<c:select name="FacilityID" label="Facility"
options="#local.getHospitals#" value="#local.defaultOffice#"
required="true" message="A facility is required" />
<c:number name="sort_order" value="#TheSortOrder#" />

Layout Manager

  • Checks permissions for page access
  • injects Helpes scope
  • Can use different layouts that a developer can specify, user profile vs list page

Random Utility Functions

  • arrayToQuery()
  • arrayCombine()
  • arraySlice()
  • arrayReverse()
  • structToArray()
  • structToHidden()
  • structToQuery()
  • structToQueryString()
  • structsToQuery()
  • csvToQuery()
  • getBoolean()
  • getNumeric()
  • findValue()
  • queryStringToStruct()
  • xmlToStruct()
  • xmlToArray()
  • queryToArray()
  • queryToCSV()
  • queryToList()
  • queryToStruct()
  • queryToStructs()

What did it solve

Why did we even do it?

  • Developers could be use to the same type of "Helper" code to accomplish tasks
  • Easy to switch between different projects, have same convention
  • Easy to start a new project and have an established base for security, layouts, etc

Problems

What problems arose from the shared framework

Too many cooks

  • Any developer can commit
  • Most will commit to fix a 'thing'
  • they miss the big picture
  • Creating branches(forks) and not merging from trunk(master) to get enhancements
  • Documentation

Ownership

Original Code Champions moved on to other opportunities

Management saw it as a large monolith code base

Developers blame their problems with it

No real documentation or good example code

If we could turn back time

What would we change

Ownership

Have sense of ownership belonging to leads to a certain extent They should know what other teams have developed that they could leverage

Sample Project with Documentation

Have a Sample Project that would be heavily documented, akin to bootstrap sample page possibly

More Components

Force more developers to add to plugins instead of the Core

Not everyone needs the code for CMS

Questions?

Minerva A brief history of the little framework that could