Blog

How to develop modules that hide complexity

When developing functionality in an app there are many design challenges for the developer. One of the most important ones that determines how easy / hard the entire solution architecture is to develop and maintain over time is how well each function / module / class that is created hides the complexity within.

The main purpose of a module in a larger system is to hide complexity

An example to illustrate this is when developing interactive CAD-configurators where the user can place components with the mouse, but a strict set of rules still need to be applied. Lets say the user can create a door on a wall section with the click of a mouse button. This requires both infomation about the click, the door and how this comes together in relation to existing components (like a wall).

The following four alternatives for the addDoor function illustrates how different approachers will impact how much complexity is hidden

1 – No complexity hidden

assembly.addDoor(doorObject, position)

An entire door object needs to be created outside the function and rules affecting position also needs to be handled outside the function – no complexity hidden

2 – Door complexity hidden

assembly.addDoor(doorType, size, position)

Only type and size is needed here but position rules still need to be outside the function – door complexity hidden

3 – Positioning complexity hidden

assembly.addDoor(doorComponent, requestedPosition)

The door object is created outside but the position is just a request and rules for actual position is computed inside – position rule complexity hidden

4 – Both door and position complexity hidden

assembly.addDoor(doorType, size, requestedPosition)

Combining 2 and 3 results in hiding of both door and placement rule complexities

There will always be trade-offs that keep you from hiding all complexity in the function. But becoming aware of this mechanism is the first step to designing good modules and well functioning architecture.

Strategies for CAD assemblies in visual configuration

With a class based definition of CAD assemblies in a web configurator there are two main strategies to choose from: Property driven or interaction driven assembly

Property driven CAD assembly

With the property driven approach there is a set of properties that are known in advance and can describe the entire assembly. The number of parts and layouts can vary but its all driven from changes in the same properties.

PRO: The benefit of this is that the entire assembly can be controlled with a single procedural sequence which can start from an empty assembly (see docs on how component handler and clearAll works).

CON: The weakness of the property driven approach is that it cannot store states in the different components (like changing a specific size).

Interaction driven CAD assembly

With the interaction based approach the assembly is generate through a set of predefined methods on the assembly class (eg. assembly.addDoor(…), assembly.configureSection(..). These methods needs to be created by the person implementing the class based configuration and carefully shaped to match the intended interactions.

PRO: This enables complex configuration guided with the mouse (drag and drop configuration) and gives a lot of freedom to the user.

CON: The drawback is the increased skill requirements and time needed for the person implementing the interaction based approach. The predefined methods need to hide complexity and handle all the edge cases of all potential mouse interactions, yet still produce a valid assembly.

Generating STEP-files from any geometry

Would you like to develop a DynaMaker application that includes static 3D files and exports STEP-files? With our Design Automation Service, you can now effortlessly generate and export STEP-files from your application regardless of if your app uses static models or not!

In our previous article on using your own static assets, we demonstrated how you can create an assembly that utilizes both static and parametric models. Here, we will expand on that concept by demonstrating how you can generate and export a STEP-File from the entire assembly. Before the Design Automation Service, it was only possible to create STEP-files from parametric models. However, with this service, you can effortlessly create them regardless.

How to use your own static assets in your CAD configurator

Do you already have your own 2D & 3D files? Then it’s very easy to reuse them in DynaMaker without remodeling them again. If there are parts in your product that remain unchanged regardless of the configuration (“static”), you can reuse your 2D & 3D files in DynaMaker for them, so that you can focus on parametric parts and others in your DynaMaker application. Learn more about this!

Template – Conveyor Layout configurator

Working with multi model configurations can be tricky. One way to simplify things is to create a predefined sequence of products where each new item connects to the next in a predictable way. This can be used for creating conveyors or similar and we have created a starting template just for that.

IT Map for Manufacturing Companies

We often get asked about the IT structure and systems needed to make product configuration and process automation happen. How are different parts connected to each other? Which departments in the company uses which systems? And how do they relate to the flow of products from purchase to delivery? Have a look at this IT map for manufacturing companies.

CAD configurator for 3D-printed motor brackets

A DynaMaker template project that generates a motor bracket that fits the NEMA standard for stepper motors. With very few inputs the user can modify the installation size and picking the right standard without having to know anything about the NEMA specifications.

You can navigate the model with the middle and right mouse buttons.

Does this template look useful to you? Contact us at sales@dynamaker.com and we can get you started with this!

Greenhouse configurator template

This is one of many template projects available for a quick start with customization in DynaMaker. It’s a simple one-step configurator that enables parametric customization of a greenhouse with automated CAD exports. See the video below for an example of how it could work for your e-commerce!