Blog

Mementifier v2.x Released!

Luis Majano February 13, 2020

Spread the word

Luis Majano

February 13, 2020

Spread the word


Share your thoughts

We are so excited to bring a major version release of our Mementifier Module. For those of you who do not know what Mementifier is, here is a small synopsis.

What is Mementifier?

This module will transform your business objects into native ColdFusion (CFML) data structures with :rocket speed. It will inject itself into ORM objects and/or business objects alike and give them a nice getMemento() function to transform their properties and relationships (state) into a consumable structure or array of structures. It can even detect ORM entities and you don't even have to write the default includes manually, it will auto-detect all properties. No more building transformations by hand! No more inconsistencies! No more repeating yourself! Best of all, it is lightning fast!

Defining Mementos

this.memento = {
	// An array of the properties/relationships to include by default
	defaultIncludes = [
		"firstName",
		"lastName",
		// Relationships
		"role.roleName",
		"role.roleID",
		"permissions",
		"children"
	],
	// An array of properties/relationships to exclude by default
	defaultExcludes = [],
	// An array of properties/relationships to NEVER include
	neverInclude = [ "password" ],
	// A struct of defaults for properties/relationships if they are null
	defaults = {
		"role" : {},
		"office" : {}
	},
	// A struct of mapping functions for properties/relationships that can transform them
	mappers = {}
}

Getting Mementos

struct function getMemento(
	includes="",
	excludes="",
	struct mappers={},
	struct defaults={},
	boolean ignoreDefaults=false
)

Release Notes

Here are the release notes for this major release:

Features

  • Enabled wildcard default includes (*) to retrieve inherited object properties instead of doing wacky things for inherited defaults to work.
  • New setting to chose a default value to expose when getters return null: nullDefaultValue
  • ORM Auto includes now ONLY includes properties to avoid bi-directional recursive exceptions. This is also a compatiblity, where before EVERYTHING was included. Now, only properties are included.

Improvements

  • Updated to cborm2 for testing harness
  • Updated to TestBox 3

Compatibility

  • Removed ACF 11 Support
  • ORM Auto includes only marshalls properties instead of everything.

Add Your Comment

Recent Entries

ColdBox 7.2.0 Released

ColdBox 7.2.0 Released

ColdBox, a widely used development platform for ColdFusion (CFML), has unveiled version 7.2. Packed with compelling new features, bug fixes, and enhancements, this release is designed to empower developers by boosting productivity, refining scheduled task capabilities, and enhancing the overall reliability and efficiency of application development. This article will delve into the key highlights of ColdBox 7.2 and elucidate how these advancements can positively impact developers in their daily coding endeavors.

Luis Majano
Luis Majano
November 20, 2023
Into the Box 2023 Series on CFCast

Into the Box 2023 Series on CFCast

Excitement is in the air as we unleash the highly anticipated ITB 2023 series exclusively for our valued CFCast subscribers – and the best part? It's FREE for CFCast members! Now is the perfect time if you haven't joined the CFCast community yet. Plus, we've got an incredible End-of-Year deal that's too good to miss

Maria Jose Herrera
Maria Jose Herrera
November 20, 2023
Ortus Deals are Finally Here!

Ortus Deals are Finally Here!

The much-anticipated Ortus End-of-the-Year Sale has arrived, and it's time to elevate your development experience! Whether you're a seasoned developer, a tech enthusiast, or someone on the lookout for top-notch projects, Ortus has something special in store for you. Brace yourself for incredible discounts across a wide array of products and services, including Ortus annual events, books, cutting-edge services, and more.

Maria Jose Herrera
Maria Jose Herrera
November 15, 2023