cancel
Showing results for 
Search instead for 
Did you mean: 

Which is the preferred view for SAPUI5 Application ?

Former Member
0 Kudos

Hi All,

1. Can anyone explain why SAPUI5 comes with multiple views such as JS, XML, JSON, HTML ?

2. On basis of performance which view is preferred?

3. On which basis the respective view needs to be chosen for project ?

4. Is it necessary to have multiple variations of view ?

Thanks,

Ajain

Accepted Solutions (1)

Accepted Solutions (1)

AndreasKunz
Advisor
Advisor
0 Kudos

Hi Ajain

1.: Because different people prefer different ways of defining their UI. And because for different use-cases different types are most appropriate (editor tools prefer working with well-structured XML). And because UI5 often is about giving choice.

2.: JSViews come without any parsing overhead, so they are fastest. However, as browsers parse the other formats very efficiently this should not be the primary decision factor.

3.: Personal preference, technical requirements, and also depending on how dynamic a View is: Some Views may have different content depending on certain factors. This cannot be specified in XML, but would need to be done in JavaScript in the controller. If such things happen all the time, a JSView may be more suitable than a declarative one. The declarative Views also did not support some features like filters in data binding (needed to be done in JS in the controller as well), so such things would also lead to JSViews being preferred, but these gaps are being reduced dramatically, e.g. in the upcoming 1.14 release.

And you can of course use different View types within one project.

4.: What do you mean?

Regards

Andreas

Former Member
0 Kudos

Thanks for the info ... it was very useful

Anyways the last question i meant to ask was

Q) Why SAPUI5 decided to have multiple variations of view rather keeping it simple with minimal approaches ? As its really confusing to choose convenient approach as every individual developers have there own choice ....

As per my personal opinion I felt there should be only two approaches i.e JS, XML or HTML to keep it simple.

AndreasKunz
Advisor
Advisor
0 Kudos

Hi,

isn't this the same as question 1?

What is your own proposal? To have two View types. Why not just one to keep it simple? Ah, well, you want to offer choice.

And more choice is what the HTMLView offers: you can easily insert custom HTML in a way that feels more natural than writing XMLViews (even though I'm not the biggest fan of how the current HTMLViews work).

XML is considered being not web-like and as over-engineered by many, so only offering XMLViews and not HTMLViews actually caused quite some criticism.

Wherever you draw the line between simplicity and choice, you never can make everybody happy.

JSONViews... okay, forget about those. They don't have any significance and they could really be removed or hidden.

Regards

Andreas

Former Member
0 Kudos

Hi,

     I do get your point, its always personal choice of individual. As I had been working on ExtJS and BackboneJS that's the reason I really tend compare with existing frameworks. Anyways, I hope working closely with SAPUI5 I would start enjoying and understanding it much better.

     As I see lots of confusion among the existing SAPUI5 developers and when I try to get the solutions they really mess up the topic. That's the reason I had to post this question.Sorry to put up the question repeatedly.

Thanks,

Ajain

AndreasKunz
Advisor
Advisor
0 Kudos

Hi Ajain,

no reason to be sorry. Rather thanks for sharing your perception!

One challenge for UI5 is indeed that it is required to serve a wide range of scenarios (from quite simple 1-2 pages apps to complex application suites) and to be used by developers with very different skillsets (some come from pure HTML development and would like to just write HTML, some come from ABAP/Java development and would like to program everything).

Hence it probably offers more options than many other UI libraries which are more specialized.

The downside is that other libraries might be more optimized for some specific use-cases, but as advantage I see that with UI5 one library skillset is enough to implement quite different scenarios, on desktop as well as mobile devices.

And as a company there is a maintenance benefit when there is not a large zoo of many UI libraries which probably all need to be extended a little bit here and there - imagine e.g. testing them all on dozens of different mobile devices and browsers.

So if you feel confused, we have to acknowledge this and to try explaining the choices more clearly. The above is just a piece of background information to explain why there is so much choice.

Regards

Andreas

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ajain,

I'm very glad you put up your questions since I faced the same issues. I'm also new to SAPUI5, but I have experience in HTML and JS. Nevertheless, the biggest problem I see in the many view types is the difficulty to find help on the internet. It has happened to me sometimes that I got stuck while programming but could not find suitable solutions because my view was in JS and the view in the thread that could have helped me was in XML. So I could either try to fix it myself or change my whole view to XML.

I hope this will ameliorate from time to time, maybe all this is still too new. I think it would already be very helpful if there was a guide on the advantages and disadvantages of the different view types or on the differences in general. The information given by Andreas is very helpful already but I would like to know if I need to gain more knowledge about XML or if I can get along with HTML and JS.

Regards

Dominik