[ovirt-devel] introduce AssetProvider (huge refactor)

Greg Sheremeta gshereme at redhat.com
Wed Mar 18 23:57:10 UTC 2015


Hi all,

[1] just landed in master. This patch introduces an AssetManager that
should always be used to get access to messages, constants, templates,
and resources. No more GWT.creating or @Injecting them into
constructors and passing them around.

If you need access to an asset in a class, use one of the following lines
of code to get at the singleton:

(in webadmin and userportal)
private final static ApplicationTemplates templates = AssetProvider.getTemplates();
private final static ApplicationResources resources = AssetProvider.getResources();
private final static ApplicationConstants constants = AssetProvider.getConstants();
private final static ApplicationMessages messages = AssetProvider.getMessages();

(in gwt-common)
private final static CommonApplicationTemplates templates = AssetProvider.getTemplates();
private final static CommonApplicationResources resources = AssetProvider.getResources();
private final static CommonApplicationConstants constants = AssetProvider.getConstants();
private final static CommonApplicationMessages messages = AssetProvider.getMessages();

(Please keep these standard variable names -- i.e., don't name them "TEMPLATES" or
"commonConstants", etc.

If you have a frontend patch pending, your rebase probably won't be clean. This
patch touches over 700 files :)

Thanks!
Greg

[1] https://gerrit.ovirt.org/#/c/38724/  (userportal, webadmin: introduce AssetProvider)

Greg Sheremeta
Red Hat, Inc.
Sr. Software Engineer, RHEV
Cell: 919-807-1086
gshereme at redhat.com



More information about the Devel mailing list