Roles are as fleeting as are doctrines and change with time or circumstances. Just take the Zumwalt as an example. It was envisioned in light of the Panama/Gulf War (invasion) but was outdated before completion because things have long (20 years already) shifted toward hypersonic missiles and global strike.
The only constraint that cannot be taken out of the classification equation is technology dependency, hence, specific technological limitations.
Many people consider the ternary chart to be the ultimate form of representing design classification:

I beg to differ because it's a simplification that is only good as an indicator. For example when you meet an unknown force and the only things you know is the ship's size/mass, speed, and maybe firepower if you're unlucky.
As a builder or engineer I would rather use these (copyrighted 😛)

As you see this is far more useful. One ship is a well rounded ship, the standard, the other a destroyer warship.

As ship sizes evolve independently from ship classification this is how level are related.