---
title: Announcing Mixen
description: Mixen allows you to mix classes together, even if they all implement the same method, to build a new class that has just the components you need.  It's made our code more testable, more maintainable, and it has made it much easier to develop new bits and pieces which might not be ready for universal consumption.
image: https://product.hubspot.com/hubfs/BlogCode_Green-Oct-03-2020-03-58-16-25-PM.png
---

[Engineering](https://product.hubspot.com/blog/topic/engineering)

# Announcing Mixen

[ Zack Bloom ](https://product.hubspot.com/blog/author/zack-bloom)

 on Aug 29, 2013

Mixen is a library that has, over the last few months, changed how we write CoffeeScript at HubSpot.

Mixen allows you to mix classes together, even if they all implement the same method, to build a new class that has just the components you need.  It's made our code more testable, more maintainable, and it has made it much easier to develop new bits and pieces which might not be ready for universal consumption.

[![Play With Mixen Now](https://no-cache.hubspot.com/cta/default/51294/6ee8a5f0-2cd1-4c5e-8d96-de04ca329d61.png)](https://cta-redirect.hubspot.com/cta/redirect/51294/6ee8a5f0-2cd1-4c5e-8d96-de04ca329d61)

At HubSpot we have a Mixin for Backbone.Model to use our API interface library.  If we mix it into a model, it knows how to talk to our APIs:

```
class ContactModel extends Mixen(APIBinding, Backbone.Model)  urlRoot: 'contacts/v1/contact'
```

 It's just like if you had made APIBinding extend Backbone.Model, but you define the relationship when you use them, not when you define them.  If we want the model to be cached, we can add the cachingMixin:

```
Mixen(Cache, APIBinding, Backbone.Model)
```

 Both mixins can have a sync method without either being clobbered. It doesn't just call each copy of the sync method, it uses the `super` concept built into CoffeeScript (but works with JavaScript too).  This means you can have a mixin which will stop the sync:

```
Mixen(Validate, Cache, APIBinding, Backbone.Model)
```

That's it! No BaseModel full of a bunch of junk no one uses, use what you need, and each mixin is just a class.  Read our documentation for more, and send any useful Mixins you make our way!

[![View Mixen Documentation](https://no-cache.hubspot.com/cta/default/51294/45c796f3-03fc-4a30-bf06-0a41477d6c70.png)](https://cta-redirect.hubspot.com/cta/redirect/51294/45c796f3-03fc-4a30-bf06-0a41477d6c70)

[Share on Twitter](https://twitter.com/intent/tweet?url=https%3A%2F%2Fproduct.hubspot.com%2Fblog%2Fannouncing-mixen)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fproduct.hubspot.com%2Fblog%2Fannouncing-mixen)[Share via email](mailto:info@example.com?&subject=&body=https%3A%2F%2Fproduct.hubspot.com%2Fblog%2Fannouncing-mixen)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fproduct.hubspot.com%2Fblog%2Fannouncing-mixen)

## Recommended Articles

<https://product.hubspot.com/blog/9-lessons-from-onboarding-new-product-managers>

[Product](https://product.hubspot.com/blog/topic/product)

## [9 Lessons for New Product Managers](https://product.hubspot.com/blog/9-lessons-from-onboarding-new-product-managers)

 Product management teaches you to think critically, make difficult decisions, and identify areas of opportunity in tough situations. How product ...

[ Magdalena Georgieva (She/Her) ](https://product.hubspot.com/blog/author/magdalena-georgieva)

 on Dec 15, 2015

<https://product.hubspot.com/blog/editing-editors>

[UX](https://product.hubspot.com/blog/topic/ux)[Product](https://product.hubspot.com/blog/topic/product)

## [Editing an Editor Experience: A HubSpot UXers Approach](https://product.hubspot.com/blog/editing-editors)

 The Sales Enablement team recently made major updates to the authoring experience in Sales Hub’s Playbooks editor tool. We needed to introduce new ...

[ Lindsay Derby ](https://product.hubspot.com/blog/author/lindsay-derby)

 on May 22, 2023

<https://product.hubspot.com/blog/behind-hubspot-ai-how-does-prediction-engine-score-millions-of-crm-objects-daily>

[Engineering](https://product.hubspot.com/blog/topic/engineering)

## [Behind HubSpot AI: How Does Prediction Engine Score Millions of CRM Objects Daily?](https://product.hubspot.com/blog/behind-hubspot-ai-how-does-prediction-engine-score-millions-of-crm-objects-daily)

 Written by Leena Bhandari, Senior Software Engineer, Öznur Alkan, Staff Technical Lead, Andrea Cicalese, Senior Software Engineer, and Nabeel Nauman, ...

[ Leena Bhandari ](https://product.hubspot.com/blog/author/leena-bhandari)

 on Nov 15, 2024

## Join our subscribers

Sign up here and we'll keep you updated on the latest in product, UX, and engineering from HubSpot.

[Subscribe to the newsletter

](https://product.hubspot.com/blog/announcing-mixen#subscription-popup)

[Back](https://product.hubspot.com/blog/announcing-mixen#)

## Get Connected

The latest engineering, UX, and product news from the HubSpot Product Blog, straight to your inbox.

Next

Not using [HubSpot](https://www.hubspot.com/) yet?

Search Term:

** Search HubSpot.com ** Search the blog

Load more