Groovy script with PersistenceExtensions


I saw that with PersistenceExtensions you need to cast it to Class to use it has variable.
like that:
static Class pe
but with ItemRegistry it’s ok with to use the class name like that :
static ItemRegistry itemRegistry

is this a bug or by design?