Don't SPEAK: Consider SPE Instead


Brandon Bruno


March 17, 2020


Don't SPEAK: Consider SPE Instead

A few years ago I dove into Sitecore's SPEAK framework (yes, it's an acronymn: Sitecore Process Enablement & Accelerator Kit). It even got kind of technical.

While writing those blog posts, I ultimately learned that the "A" in SPEAK - accelerator - was anything but if a developer is already not well-versed in SPEAK paradigms. I have since started using a great alternative to SPEAK development: Sitecore PowerShell Extensions.

SPEAK 101: Pros & Cons

SPEAK defines development standards and provides tooling for developing applications inside the Sitecore client backend. The Sitecore client is built with a mix of Sheer UI and SPEAK technologies, so by providing an SDK, developers can create apps with Sitecore-native UI and data access functionality. Providing a rich, responsive, and consistent UI for custom applications helps keep content authors and users comfortable with their environment.

Unfortunately for developers, the learning curve for SPEAK is very high. Only a few common Sitecore concepts - like layouts and sublayouts - apply to SPEAK applications. Most of the SDK involves data access layers, rendering technologies, and a unique delegation of back-end and front-end responsibilities that most Sitecore developers won't be familiar with. Visual Studio plug-in Sitecore Rocks is required for SPEAK development, and while it's a nice tool for certain developer workflows, it's not for everyone. When it comes to development tools, less is sometimes more. Finally, the development workflow for building with SPEAK is a bit wonky - jumping all over between JavaScript, C#, Sitecore Rocks, the Sitecore Client without any recommended best practices on how to streamline the dev process.

Why Sitecore PowerShell Extensions?

With the introduction and popularization of Sitecore PowerShell Extensions (SPE), I've found a reasonable development alternative to SPEAK applications. SPE provides many of the same benefits of SPEAK with fewer downsides for developers.

First, SPE's interactive dialogs provide a mostly-native UI inside the Sitecore Client for users to interact with. While this doesn't provide a fully-customizable, highly-interactive interface, the mostly form-based elements of SPE's dialogs can cover many use cases.

Second, SPE provides cmdlet-based access to the Sitecore API. SPE's authors have written many cmdlets that wrap Sitecore API methods, providing functionality around workflow, item management, and many other aspects of Sitecore. PowerShell itself allows managed code to be called from imported libraries (i.e. Sitecore DLLs), so any funtionality not covered by cmdlets can be made available to PowerShell code.

Third, the learning curve for SPE is relatively shallow. Any developer that knows PowerShell should be immediately productive inside SPE. Sitecore-specific cmdlets and unique functionality are well-documented, and the module comes with dozens of code samples to provide inspiration.

Fourth - and most importantly - Sitecore PowerShell scripts are stored as content in Sitecore. Traditional MVC or Web Forms development require a lot of ceremony (write, compile, test, push build, reload app pool, wait...). Because PowerShell scripts are interpreted (rather than compiled), they can be modified and executed instantly. This dramatically reduced development and deployment times. For example, a SPEAK application that may take days to write, test, and deploy could potentially be done in a matter of hours with PowerShell.

How to Decide Between SPE and SPEAK

Before developing an application using SPE instead of SPEAK, ask yourself a few questions:

How much experience does your development team have with SPEAK?

If a portion of your team has demonstratable experience with SPEAK, consider how much of the experience can be shared across the team when developing and maintaining a SPEAK application.

How experienced is your team with PowerShell?

PowerShell is a commonly-used tool for .NET and Windows developers. Existing PowerShell experience can translate into Sitecore PowerShell very quickly. For those who are inexperienced with PowerShell, it's conceptually similar to most other programming languages, but its syntax can be difficult to learn.

Does our application require real-time interaction?

If your needs require real-time interaction (for example, an image editing tool), SPEAK may be the better option. If, however, you can get away with transactional-style input and outputs, SPE would work just as well: gather input, process it, display some output. Because the learning curve for SPEAK is so high, it may be worth re-scoping an interactive application into a transaction interface to allow SPE to be a viable option.

Is this application mostly reporting?

If you're creating a reporting tool, strongly consider using SPE. SPE provides interfaces and cmdlets that natually lend themselves to generating reports, especially the Show-ListView cmdlet for creating tabular output and data export to many different file types.

How quickly do we need to deliver the application?

As mentioned above, creating a SPEAK application requires a full development cycle - write, test, build, deploy - on top of a rather convoluted development process inside and outside of Sitecore. SPE requires writing a PowerShell script using common PowerShell and custom, Sitecore-specific cmdlets, which can then be ran right away inside any Sitecore instance. A word of caution: while SPE scripts are flexible and easy to execute, developers and admins should take precaution to not develop scripts too quickly and make use of testing and QA gates before deploying SPE-based tooling to higher environments.

Who will maintain the application?

Because development with SPEAK is specialized skill inside a specialized CMS, the pool of experienced SPEAK developers is relatively low compared to the pool of developers who can read/write/architect with PowerShell. Long-term maintenance of an application is as equally important as upfront development effort, so consider who will be maintaining your application in the future. SPE will likely be easier for developers to pick up and understand over SPEAK (which again, requires specialized knowledge and tooling on top of Sitecore knowledge).

Useful Links

There is no comprehensive guide to writing interactive applications with SPE, but several of my past articles touch on the basics concepts. Here are some useful links to get started writing applications with SPE and its library of interactive dialogs:

Do you have questions, comments, or corrections for this post? Find me on Twitter: @BrandonMBruno