Hamming graph is known to be an important class of graphs, and it is a challenge to obtain algorithms that recognize whether a given graph $G$ is a Hamming graph . Let $G$ be a group and $S\subseteq G$ be a nonempty subset of $G$. The Cayley graph with respect to $S$ is a graph whose vertex set is $G$ and arcset is the set of pairs $(u,v)$ such that $v=su$ for some element $s\in S$. This graph is denoted by $\Cay(G,S)$. Let $R=\oplus_{i}R_{i}$ be a graded ring, $S$ be the set of homogeneous elements of $R$, $S'$ a subset of $S$, and $S''=\oplus_{i\geq k}R_{i}$. In this paper, with a different view, we study $\Cay(R, S')$ as a generalization of $\Cay(R, S)$ to obtain a new point of view to study Cartesian products of complete graphs (Hamming graph). In particular, we show that any \textit{Hamming graph} over sets of prime power sizes is isomorphic to $\Cay(R,S')$ for some graded ring $R$ and a subset $S'\subseteq S$. Also we study $\Cay(R, S'')$ as another Cayley graph over graded rings and obtain relations between this graph and total, cototal and counit graphs.