Secondary IP addressing v. Subinterface IP addressing

in CCNA & CCENT
Am I right in saying secondary IP addressing and subinterface ip addressing are mutually exclusive? I would imagine you would only use secondary IP addressing if you only have one vlan? And subinterface IP addressing if using mulitple vlans? Am I correct in assuming that? Any help would be greatly appreciated.
Comments
You would use secondary IP addressing to increase the number of available ip addresses.
You would use a sub-interface per Vlan for the router to route between Vlans.
CCIE R&S - using INE workbooks & videos
Currently reading:
Everything. Twice
Free Microsoft Training: Microsoft Learn
Free PowerShell Resources: Top PowerShell Blogs
Free DevOps/Azure Resources: Visual Studio Dev Essentials
Let it never be said that I didn't do the very least I could do.
So, does sub-interface addressing create a default gateway for that particular vlan's subnet? I'm still confused sorry.
Yes, the sub interface ip can be used as the default-gateway for the vlan. The sub interface allows the packets to be tagged (or untagged if you use the native) over the trunk to the switch. The secondary ip can also be used as a default-gateway but does not tag the traffic withoug using a subinterface.
Excellent, thank you. I would imagine that in real world application the subinterfaces option is more popular. I would think you'd get greater design flexibility, no?
Yes you are correct. The only time I have used secondary ips personally was for temporary moves of devices when its easier to leave the current ip on instead of renumbering. I have seen them used for the lazy reason mentioned earlier to get more ips on a vlan. That is poor design IMO though.