# Redefine \title command in custom class

I am currently writing a custom class that inherits from a standard class (article), and I would like to redefine the \title command, so that the end user can call it, and I would be able to get the result of that command, modify it a tiny bit, and input it to the \title command of the base class.

Actually, when writing this question, I have found a way of doing this. Here is a MWE, with the class file Test.cls:

\ProvidesClass{Test}

\title{\@testTitle, isn't it?}
\renewcommand*{\title}[1]{\def\@testTitle{#1}}

\endinput


And the user file:

\documentclass{Test}

\title{A great article}

\begin{document}
\maketitle
\end{document}


So in the end, the user chooses a title, but the results outputs an article with the modified title.

Is it the standard way of doing? How would you improve it?

Similar to this question, you can use etoolbox's \patchcmd to modify the \maketitle command:

\documentclass{Test}
\title{A great article}
\begin{document}
\maketitle
\end{document}


Test.cls

\ProvidesClass{Test}

In general, you can use \show\somecommand to see what the definition of \somecommand is, and then find the part you want to patch.