IT Design

(Some) Best Practices in Design

Note: This is far from an exhaustive list, and will be updated occasionally to reflect that.

Design First

Always design first. Even if it is an agile project with an aggressive timeline, a clear understanding of what your solution will look like and the steps to get there will make the path easier to get to. Designing first is the opportunity to think through what you will be doing and recognize potential issues in advance. Often when design issues show up late they are dealt with as code flaws rather than design flaws, taking longer to correct and often leaving the design issue in the “fixed” result.

When I can recall the exact wording and attribution I will update this post…meanwhile, not defining an architecture is an architecture. Some refer to it as a Big Ball of Mud. I particularly like Gregor Hohpe’s many takes on this choice. Here is a link to an older-but-still-accurate blog post of his.

Developers need to Design, too

Your design can be as simple as stubbing out all of your classes before developing them. This way, issues that were missed during the design phase are more likely to be discovered earlier, before they become harder to fix.

Test-Driven Development is another approach to catch issues early on.

Insist on Design Review

Have a technical lead or peer review your design. The additional perspective is always helpful, either by validating that your approach is sound or questioning choices and reviewing options found by a fresh set of eyes.

Environment Variables

Environment variables should be maintained in the environment. Placing these variables in components where they must be updated between environments reduces the value of such variables and increases the chance of errors when migrating deployments between environments.

Balance Early Adoption with Out-of-Date

Going first in a presentation is brave. Being first to apply a new technology in an enterprise is always risky, and those risks must be seriously weighed beyond the “cool factor” of being an early adopter. Once you have committed to early adoption, mitigate risk with thorough testing and following any active communities taking the same journey.

Because of the frequent and rapid changes in technology, the familiar approach is not always the safest. Libraries, functions, features and patterns currently in use at your enterprise may be heading toward deprecation and retirement. With vendor products, especially cloud platforms, a newer, better approach could be available that is solid and well-tested (depending on the vendor, YMMV). Always check for newer alternatives before committing to a solution, and weigh the alternatives for fit both from a functional perspective and maintenance implications. And…

Don’t Trust, Verify

Vendor claims are written by the marketing team, not the development or support teams. If a vendor states that Product X provides feature Y, validate that it does and that it does it in a way that supports your design before committing to it.

DevOps

Yes, DevOps is a category unto itself, and it also needs to be considered during the design phase. Retrofitting DevOps practices is often difficult. For greenfield projects, prepare a detailed recommendation on the benefits of DevOps for the application and the steps necessary to implement and maintain. For enhancement projects, review the technology landscape for potential and recommend accordingly.

Test Automation Design

Not all applications are the same, so using the same tools and patterns for all applications won’t work. That isn’t to say they can’t be reused across applications. What is important is not to assume fit for purpose. At a minimum, review the current state of the are for the tools you are familiar with, who their competitors are, and then try things yourself before believing any hype. This review should be repeated regularly once the test stack is designed to maintain relevance.

If you found this interesting, please share.

© Scott S. Nelson
File Trash Recycle BingAI

Taking out the Salesforce Garbage

I don’t know why the process to permanently delete objects from Salesforce was hard for me to find today (was looking for a link to send to someone on Trailhead) but I did not find any succinct answer before my AADD kicked in, so here are the steps:

  1. Switch to Classic mode
  2. Go to Setup, then Custom Objects (search for Objects or scroll to Build > Create > Objects)
  3. At the bottom of the list there will be Deleted Objects (#) if there are any (sometimes referred to as the Recycle Bin, as I believe that was the pre-Lightning name of the section).
  4. From there you can permanently delete them before they go away on their own after 15 days.

Hope this helps someone!

If you found this interesting, please share.

© Scott S. Nelson

Yet Another Tech Debt Post

Quick summary: Technical debt is the elephant in the room … the same elephant that the blind men were curious about. Understand how perspective contributes to and can resolve tech debt.

Logic20/20 has been involved in many platform migrations and technology refreshes. While there are myriad reasons to make such a major shift, the three key drivers are:

  • Gaining new capabilities
  • Increasing time to market
  • Reducing costs

Most other reasons will fit into one of those three, and usually it is more than just one of the three. All three are valid and valuable reasons to commit what is usually a large amount of resources to achieve. What is seldom acknowledged is that the initial motivation for the expense is to deal with technical debt.

Boom. Yes, that is a big statement. Let me unpack it a bit. Most new capabilities can be added through adapters or integration. Time to market can be severely hampered by technical debt, as can the costs associated with development and maintenance. That isn’t to say that upgrades and technology shifts aren’t necessary, only that the tipping point frequently comes from the accumulation of technical debt.

Once the transition to a new platform (be it an upgrade or vendor change) is complete, what follows depends on whether the influence of technical debt was acknowledged as part of the effort. Organizations that utilize processes, policies, and governance to manage technical debt can find that their ROI from the project will more than justify the expense. Those that do not recognize the contribution of technical debt to the problems with the old way of doing things and believe the issues were only within the platform will find that they will be ready for another migration in as little as one year.

The thing about technical debt is that it is not always recognized because of the different perspectives that result in its accumulation. I think of these as WhatWhy, and How. My experience is that the order of how these perspectives are realized determines the organization’s maturity in relation to managing technical debt. It is when they are recognized in the reverse order that it takes longer to reach a point where the organization is managing technical debt.

How is a technical aspect. It is the use of architecture, design, and implementation solutions that focused on the immediate need over the long-term solutions. At the time the decisions are made that lead to technical debt, the technical team usually knows it is happening and has hopes (if not actual expectations) to address the debt in later releases.

Why is a business problem, and is also more a series of questions than a statement. Was the initial debt incurred by informed decisions? Is the increasing debt the result of planned obsolescence or not knowing the impact? Are they even aware that their drive for business capabilities resulted in technical debt? The diagram at the end of Martin Fowler’s TechnicalDebtQuadrant post is the clearest representation of what leads to technical debt. Frequently the types of conversations necessary to make informed decisions don’t happen because technology and business make assumptions about viewpoints that are generally inaccurate. Communication is always a key factor to enterprise success.

What is a universal, once it is recognized either by the How or the Why: It is architecture and design issues that impede progress through time spent on maintenance and work-arounds. The How cannot change the What unless there is an important Why. In other words, the debt will not be reduced by technical teams unless there is a good reason for the business to pay for it.

The first step is reducing or eliminating the accumulation of technical debt. The second step is to determine how much focu$ will be dedicated to each release to reduce the technical debt. In most cases, this should be a gradual process of adopting new patterns and spending some time in each release refactoring what is related to the release. In some cases, the impact is so pervasive that either an entire release needs to be focused on refactoring or one team needs to be dedicated to it for one or more releases until is manageable again. Whereas most technical debt has a common cause, the path out of technical debt needs to be tailored to the enterprise and the system to be successful.


Originally publihsed at https://www.logic2020.com/insight/tactical/technical-debt-what-why-and-how

If you found this interesting, please share.

© Scott S. Nelson
Select Query in Workbench

How to re-assign Salesforce object ownership in bulk

Here is a question I see frequently in the Trailhead Community: How do you re-assign the ownership of objects in bulk? I’m sure there is an app to make this easier, and I suggest you look in the AppExchange if the policy for your org is to use apps first. And I know there are other solutions, this is just one that I find quick and easy because I don’t have to give it too much thought.

Accounts before Owner Change

First: Always try it in a sandbox first and test the results before doing it in production.

Second first, locate the user id of the person who’s object owners ship you want to change from. From their user page (or just copying the link), grab the object ID from the URL.

Find Object Owner

Copy Object ID
Copy Object ID

Now open Salesforce Workbench in another tab, login and navigate to Queries > SOQL queries. If you are adept at SOQL, create a query to pull all of the object you want to re-assign based on the user id. If you are not comfortable writing your own SOQL or just feeling lazy, use Workbench to help create the query:

Select Query in Workbench

The key values you want are the object ID and the owner ID, though adding a Name field to check the values can be helpful. Be sure to select View as Bulk CSV then run the query. Save the resulting file. I recommend naming it something that is meaningful to you rather than accepting the long string produced by default. Open in your favorite CSV editor to see the object and owner ids.

Next, get the user ID of the new owner(s) the same way you did for the current owner. In the CSV file, change the OwnerId value as desired.

For safety reasons, delete all columns from the csv file except Id and OwnerId, then save it with a different name as a CSV file.

Object and Owner IDs only

Back in Workbench, go to Data > Update. Select the object type and click the Choose File button and select the file you just created with the new OwnerId(s), then click Next.

On the mapping screen the values should already be mapped. Check that only the ID and OwnerId are mapped and click the Map Fields button. If there are many records, check the “Process records asynchronously via Bulk API” option on the resulting page then Confirm Update. Note that if rules were changed since the records were created you may have errors that will require fixing the records before they can be updated.

Could happen if rules changed since created

And in list view:

After Owner Change

If you found this interesting, please share.

© Scott S. Nelson
Virtual Box Disk Space

Managing VirtualBox VDI size for a Linux Guest

If you are just looking to save space on your operating drive, always remember to use the Description box for snapshots and delete those you no longer need.

And if the guest host is Ubuntu, see some good pre-wash steps at https://itsfoss.com/free-up-space-ubuntu-linux/.

Assuming you are using a dynamic disk you can perform the following steps below save more space:

Check for a dynamic disk VDI
Verify the VDI is a dynamic disk

From within the Linux guest, run the following in a terminal:

dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k ; rm /var/tmp/bigemptyfile

It will take some time to complete. Depending on the size of the disk and the amount of empty space, it can be a long time, so be patient.

When the commands complete, shut down the guest.

The next step is to run VBoxManage.exe. First, locate where VirtualBox is installed. This is usually C:\Program Files\Oracle\VirtualBox, though you can also find it by checking the path of the VirtualBox launch icon:

Find the VirtualBox install location from the launch icon properties
Find the VirtualBox install location from the launch icon properties

Open a commend prompt (search for cmd.exe) and cd to where VirtualBox is installed:

cd "C:\Program Files\Oracle\VirtualBox"

Locate and copy the path to the VDI:

Locate and copy the path to the VDI
Then run VBoxManage as follows:
VBoxManage.exe modifymedium disk “[absolute path]” –compact
ex:

VBoxManage.exe modifymedium disk "T:\VirtualBoxes\Ubuntu_21.04_withVPN\Ubuntu_VPN_21.04-disk002.vdi " –compact

I also back mine up, which is why I need to reduce the size.

VirtualBox Export Appliance Menu

 

If you found this interesting, please share.

© Scott S. Nelson