function viewFactory(sId, vView, bAsync) {
		var mSettings = {}, oView;

		if (vView && typeof (vView) == "string") { // instantiation sap.ui.jsview("id","name", [async])
			mSettings.viewName = vView;
			if (typeof arguments[2] == "boolean") {
				mSettings.async = bAsync;
			} else if (typeof arguments[2] == "object") { // arguments[2] is somehow a controller
				mSettings.controller = arguments[2];
				mSettings.async = !!arguments[3]; // optional
			}
			if (mSettings.viewName.startsWith("module:")) {
				throw Error("Legacy factory sap.ui.jsview doesn't support typed views!");
			}

			oView = new JSView(sId, mSettings);
			return oView;

		} else if (vView && typeof (vView) == "object") { // definition sap.ui.jsview("name",definitionObject)
			// sId is not given, but contains the desired value of sViewName
			mRegistry[sId] = vView;
			sap.ui.loader._.declareModule(sId.replace(/\./g, "/") + ".view.js");
			Log.warning("For defining views, use typed views with 'sap.ui.core.mvc.View.extend()'.");
		} else if (arguments.length == 1 && typeof sId == "string" ||
			arguments.length == 2 && typeof arguments[0] == "string" && typeof arguments[1] == "boolean") { // instantiation sap.ui.jsview("name", [async])
			mSettings.viewName = arguments[0];
			mSettings.async = !!arguments[1]; // optional
			/*** STEP 1: create View ***/
			oView = mSettings.id ? new JSView(mSettings.id, mSettings) : new JSView(mSettings);
			/*** Step 3B and 4B (create and connect controller) happen in View ***/
			return oView;

		} else {
			throw new Error(
				"Wrong arguments ('" + sId + "', '" + vView + "')!" +
				" Either call sap.ui.jsview([sId,] sViewName) to instantiate a View" +
				" or sap.ui.jsview(sViewName, oViewImpl) to define a View type.");
		}
	}
The old view factory implementation

@param {string} [sId] ID of the newly created view, only allowed for instance creation
@param {string|object} vView name or implementation of the view
@param {boolean} [bAsync=false] whether the view source is loaded asynchronously
@returns {sap.ui.core.mvc.JSView} the created view instance
@private