Tuesday, 22 July 2014

Metadata redefinition 2: how?

Metadata redefinition is the basis for Metrici's versatility, productivity and simplicity. How does it work?

Metadata is data about data. Within Metrici, everything is a node, and the data and behaviour of a node is fully described in its node type and member types. Node types and member types are therefore the metadata within Metrici.

But it doesn't stop there. Node types and member types are themselves nodes. They are defined using other node types, which we call node type types and member type types, which are also nodes. You can think of node type types and member type types as the tools that you use within Metrici. Metadata redefinition involves creating node type types and member type types, or new tools, to make the development of solutions as simple as possible.

This approach streamlines simple requirements and makes it easier to build complicated solutions.

As an example of streamlining the simple, creating questions for questionnaires is simplified by using the Question member type type rather than the standard member type type. It uses more familiar terms like "text", "number" and "repeat", rather than "value", "scale" and "cardinality", and makes it easy to pick different formats without having to know about display properties.

To give a more complicated example, file handling member type types create components to manage the upload and display of images.

Sample Metrici Gallery

You can use the file handling member type types to create gallery components

Internally, these are complicated: you need to control where images are stored, you may need to downsize images and generate previews, and you may need to link the images to other nodes. The member type types encapsulate the processing and present it in more familiar terms. And because it is all just data, it is easy to use these tools to create the specific file handling components that your solution needs.

A handful of techniques are used to define and redefine metadata in Metrici. Derivation converts tool parameters into the underlying standard metadata or API calls. Member type types can use templates to specify prototypes that acts as a basis for member types. Extension scripts create additional content within the user interface.

What metadata redefinition delivers may seem similar to the features of other platforms, but there are two key differences that make it more versatile and simpler:
  • Metadata redefinition allows new tools to be created within the platform itself. The Metrici libraries provide a large number of types and tools that meet the needs of most solutions, but if your solution could benefit from a new sort of tool, you can extend the standard set of tools to provide the ideal environment for creating your solution.

  • Everything is data based. Small amounts of scripting are used to control processing, but these scripts are just part of the data, and types and tools can be used just as data without further programming.
What I really like about metadata redefinition is that it removes constraint. Metrici has a very versatile data model, but if we used any other approach, the versatility of the data would be compromised. As it is, we are only scratching the surface of what it can do.

© Copyright 2014 Minimal IT Ltd. See the Minimal IT website for the original newsletter and copyright information.

Tuesday, 15 July 2014

Metadata redefinition 1: what and why?

Metadata redefinition is the most powerful feature of Metrici. But what is it, and why is it useful?

Like a lot of systems, Metrici uses metadata, or "data about data". Metrici's use of metadata is very extensive. Entire solutions are developed simply by defining them in data, which means that you can create new solutions very quickly. But what really sets Metrici apart is that the metadata is itself defined by other metadata, and so the way of defining metadata can itself be redefined to exactly match the needs of the solution.

This may sound like gobbledegook, so let's explore it from a number of angles.

Whatever type of solution you are building, you need to work with appropriate paradigms and tools. If you are building a content management solution, you need to work with pages, images, taxonomies and content workflows. If you are building an assessment solution, you need to work with questions, questionnaires, assignments, responses and reports. By changing how you define solutions, Metrici lets you develop any solution using the most appropriate paradigms and tools. Metrici isn't a "one size fits all" approach, it supports multiple specialised approaches for different types of solution. It even lets you merge paradigms to create solutions that would be near impossible using traditional methods.

Another way of thinking about Metrici is as an evolution of how we build computer solutions.

A traditional computer solution has fixed functionality. To meet more requirements, more functionality is added, but this leads to bloat because most users only require a small proportion of the functionality. Even a bloated system does not meet all requirements, so solutions add user-definable data and functions and possibly an API. But these are still constrained within the original design of the solution, and require considerable skill to integrate. However you approach it, traditional computer solutions have constraints and tend to bloat, and you can only get out of this with complex programming effort.

Metrici solutions are not constrained. Because solutions are defined in metadata, and the metadata fits the concepts and requirements of the solution, it's much easier to extend the solution to meet additional requirements and to exclude functionality you don't need. Solutions developed in Metrici can achieve a high fit to requirements, without bloat, and without resorting to complex programming effort.

Metrici is similar to component or object-based development. It allows you to create encapsulated components that can be combined to build solutions. But Metrici has advantages over traditional component-based development. It supports many paradigms, and the solution does not have to be written in an object-oriented way or conform to a pre-defined object model. Because it is metadata-driven, you can create reusable components without complex programming. Because all components are just nodes, components from different sources can be combined seamlessly. And because the data and metadata are all maintained within the same tool, you do not need a separate set of tools and skills to achieve the benefits of component-based design.

The ability to define solutions in data, and redefine how those definitions are created and maintained, is the basis of Metrici's versatility, productivity and simplicity. Next week I will go through an example of how to do this.

© Copyright 2014 Minimal IT Ltd. See the Minimal IT website for the original newsletter and copyright information.

Tuesday, 8 July 2014

Display properties

Display properties control how data is presented and how the user interacts with it.

Last week we covered how to use Metrici to create and maintain any data structure. Although versatile, the structures we created were unrefined and difficult to use. We can fix this by setting display properties.

There are lots of different display properties, controlling different aspects of the display. Most properties apply to member types, but there are node type properties too.

For member types with values, there are properties to specify whether values are single line, plain text, or text with HTML markup. You can set CSS classes which switch on an editor for text, or a date picker for dates.

Interlinked nodes are used for many purposes in Metrici, and so there are lots of properties to control link targets. By setting a list of possible targets on the member type, you can present targets as a drop-down list, radio buttons or check boxes. You can switch on mobile-friendly large buttons. You can change what caption is shown when no target is selected. You can control whether descriptions are shown next to targets, and whether hyperlinks are shown.

Layout properties modify ordering. You can modify the order in which the value, scale and target are presented, and what they are called. You can sort members, and you can sort targets in a target list.

You can control whether a member type is shown in browse mode, in edit mode, or when there is no data. You can add sequence numbers, for example to number questions on a questionnaire, or switch off headings.

You can set additional text to be shown in edit mode, before the input fields, before the value, scale and target, and at the end. This is useful for giving instructions or asking questions.

You can use properties to add CSS classes to member types, and there are properties to add style statements to further control appearance.

On node types, you can control which buttons to show, for example whether to show the Apply button, and what to call the Save button.

Look in the Metrici Development Guide for a full list of display properties.

To try properties out, have a play with the types you created last week. You will see that the node types and member types have a Display Properties tab, where you can select properties from a drop-down list and enter values. You can get an idea of what's possible by using a node type that we use to test different member type options. In a suitable package, create a new node using type metrici.library.MemberTypeGallery.MemberTypeGalleryType. See how the different member types appear and behave as you edit them.

Adding display properties to member types and node types makes them easier to use, but it adds to the complexity of setting them up. I find it hard to remember what all the display properties do, and I have to constantly remind myself by looking at the documentation.

We can make things much simpler by using the most powerful feature of Metrici, metadata redefinition, which I will cover next week.

© Copyright 2014 Minimal IT Ltd. See the Minimal IT website for the original newsletter and copyright information.

Wednesday, 2 July 2014

Node types and member types

Metrici node types and member types allow you to define any data structure.

In last week's newsletter we covered how Metrici stores member data. This week is a practical session on how to configure Metrici to do this.

You can follow the examples yourself. If you have an account, sign in. If you haven't got an account, sign up for free. Or, if you prefer, watch the video.

Step 1 - Create a package

Packages provide a place to hold nodes.

From your home page, click on the New button, and then select Package on the New menu. Call the new package Types Example. Click on Save, then click on Types Example to open the package.

Step 2 - Create a node type

Node types define the data that nodes hold by listing member types that the node should use.

Inside Types Example, click on New, and select Type.

Call your type Example Type. We can use built-in member types to start with. In the Member Type List, enter system.NODE_NAME in the Member Type column, and click on Apply. This will open up a new row. Enter system.NODE_DESCRIPTION, apply, and then system.NODE_LIST. Save to return to the package.

Step 3 - Use your node type

You can use the node type you have just created to create your own nodes. Copy the web address of the node type, and then navigate back to the Types Example package. Click on New, and paste the address of your type into the box at the bottom of the New dialog.

This will create a new node based on your node type.

Give your new node a name and a description. In the node list, link to other nodes by entering their references (like system.NODE_NAME) or pasting in their page addresses (like https://www.metrici.com/system/NODE_DESCRIPTION). Use Sequence to reorder the list. Save your node when you are finished.

Step 4 - Create your own member types

Go back to the Types Example package, and use New to create a new Member Type.

Call the member type Full Member Type. On the Basic tab, set Use Value and Use Scale to True. Click on the Target tab and set Use Target and Allow Other Targets to True. Click on Save.

Go back to your type, and click on Edit at the top of the page. Add your new member type to the member type list (it should be in the drop-down list) and Save. Find the node you created in Step 3 and edit it. You should have a new member type that lets you enter values, scales and targets.

Now create a member type called Text Member Type that has Use Value set to True and a Maximum Cardinality of 1, and add it to your type. It just produces a text box.

You can repeat this as much as you need, creating new member types with different storage models and adding them to node types. By using targets to link between nodes you can create any data structure.

But there is a problem. Although it is very flexible, the nodes you create can be ugly and difficult to use. Next week we will cover display properties which let you control the appearance and behaviour of your types and member types.

© Copyright 2014 Minimal IT Ltd. See the Minimal IT website for the original newsletter and copyright information.