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

Ortus June 2024 Newsletter!

Ortus June 2024 Newsletter!

Welcome to the latest edition of the Ortus Newsletter! This month, we're excited to bring you highlights from our sessions at CFCamp and Open South Code, as well as a sneak peek into our upcoming events. Discover the latest developments in BoxLang, our dynamic new JVM language, and catch up on all the insightful presentations by our expert team. Let's dive in!

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang June 2024 Newsletter!

BoxLang June 2024 Newsletter!

We're thrilled to bring you the latest updates and exciting developments from the world of BoxLang. This month, we're diving into the newest beta release, introducing a new podcast series, showcasing innovative integrations, and sharing insights from recent events. Whether you're a seasoned developer or just getting started, there's something here for everyone to explore and enjoy.

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang 1.0.0 Beta 3 Launched

BoxLang 1.0.0 Beta 3 Launched

We are thrilled to announce the release of BoxLang 1.0.0-Beta 3! This latest beta version is packed with exciting new features and essential bug fixes, including robust encryption functionality, enhanced Java interoperability, and more efficient event handling. Key highlights include the introduction of query caching capabilities, seamless coercion of Java Single Abstract Method (SAM) interfaces from BoxLang functions, and support for virtual thread executors. So, let’s dive into the details of what’s new in BoxLang 1.0.0-Beta 3 and how you can start leveraging these updates today!

Luis Majano
Luis Majano
June 28, 2024