cancel
Showing results for 
Search instead for 
Did you mean: 

Few clarifications in Developer studio - Java

praveenkumar_kadi
Active Contributor
0 Kudos

Hi

I have following clarifications to be cleared. Please help

1>I have observed in studio, that I can do context mapping directly between view and model without controller mapping. Any reason why this is enabled as we all know that view cannot directly talk to model..Is it reflects in design ? or runtime ?

2>I am able to create a context with only attributes and without any node above....Is this valid one? Can i do like that ? Is there any advantage with only attributes in the context..?

Points will not be constraint.

Thanks friends

Praveen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Praveen

have following clarifications to be cleared. Please help

1>I have observed in studio, that I can do context mapping directly between view and model without controller mapping. Any reason why this is enabled as we all know that view cannot directly talk to model..Is it reflects in design ? or runtime ?

Not Good Practice , You wont get any error in Runtime if you do also. View->CC->Model Good Practice and Advisable

2>I am able to create a context with only attributes and without any node above....Is this valid one? Can i do like that ? Is there any advantage with only attributes in the context..?

Yes , you can create your won attributes in root node directly. If you put table go for Node->attributes

Depends upon requirement

No advantages / Disadvantages every thing comes under good design

Points will not be constraint.

Thanks friends

Praveen

Edited by: Sridhar Sabbani on Feb 19, 2009 1:39 PM

Edited by: Sridhar Sabbani on Feb 19, 2009 1:40 PM

praveenkumar_kadi
Active Contributor
0 Kudos

Hi Sridhar,

Thanks for the answers. For the first clarification, I am still in doubt that, if it's not a good practice, why it is allowed in design time. Also WebDynPro Java strictly follows MVC pattern. If view is allowed to talk to model directly, then I have to decide that it doesn't followes the MVC pattern at all.

Please clarify.

I have given you points.

Thanks

Praveen

Former Member
0 Kudos

Yes

I also agree with you View can access model directly.

We need to ask SAP.They may delivering new service packages disblang directly with View to Model mapping. You can give suggesion to SAP ))) hahhah they should consider your point.

Have a great day. If it answered please close the thread.

Rgds

-SS

Former Member
0 Kudos

>

> Hi Sridhar,

>

> Thanks for the answers. For the first clarification, I am still in doubt that, if it's not a good practice, why it is allowed in design time. Also WebDynPro Java strictly follows MVC pattern. If view is allowed to talk to model directly, then I have to decide that it doesn't followes the MVC pattern at all.

> Please clarify.

> I have given you points.

> Thanks

> Praveen

Hi,

Its up to the user to follow the best practises, if you think that this is not a good practise and if you need to reinvent, how will you do it if its tightly couple to some thing which is a good practise today may not be tomorrow.

Another reason if you want to check a property of an UI element(a test scenario will it work or not) .will you follow all the MVC principles?

Regards

Ayyapparaj

Answers (3)

Answers (3)

praveenkumar_kadi
Active Contributor
0 Kudos

Thanks guys

Former Member
0 Kudos

Hi ,,,

This is not good pratice for mapping between view and model.some requirement have bound to mapping view and model..in case of if you want to update manually data into back end quickly instead of mapping commponent.

suppose same thing you want to update through component then it will tale some time to modify this thing..

Thanks

Sudhir

former_member185086
Active Contributor
0 Kudos

Hi Praveen

I explain why it is violated the MVC pattern

  • View is always considered as Data Consumer or Caller of the logic which is implemented somewhere in

Top level Controller and once the application is instantiated the run time is passes through Component Controller>Custom Controller(if any)>Window Controller --> finally it reaches to View Controller, here only

Presentation logic is handled that is All Navigation,Event Handler ......

Of course some run time effect will be there is we violate this rule.

*Only attribute in context , root node will considered as its parent (Why ?).

b'zWdcontext always represent Root Node of the the Hierarchy and then only we access Attribute or Node

wdContext.currentContextElement().get<..>

wdContext.nodeUsersFromFileDataNode().currentUsersFromFileDataNodeElement().get<..>

Now It is not the best practice because content wise data should be in logical grouping in java terminology

content should be well packaged.

For example most of the situation come when we have to define properties related to View (Is VISIBLE,Is ReadOnly,Is Enable and so on say 5-10 attribute rather than defining as independent attribute define it under node say ViewProperties , At runtime it will easily manageable by webdynpro framework of course it help us in terms of performance.

  • One last point about your query that why it is there I'll explain it in different way-- We have Window controller concept also, But it is not yet implemented or as per my experience I did'nt find any situation where I have to use this controller

But *SAP Genius * guys have put it ,It means in future release it will add some significant value to framework.

Hope I will help you.

Best Regards

Satish Kumar

chander_kararia4
Contributor
0 Kudos

Hi Praveen,

Answer to Point No.2 -

You may use attributes without the node but suggest you never do that. It has many disadvantages incase of bigger applications where you may have many number of attributes.

One Ex. - Suppose you have to create 4 tables, all of which contains the Employee_Name as 1 column but have alltogether different set of data. So, you can do the things like below

Without Node:

Att_Empolyee_Name1

Att_Empolyee_Name2

Att_Empolyee_Name3

Att_Empolyee_Name4

or,

With Node:

Nod_<1stTableName>

Att_Employee_Name

Nod_<2ndTableName>

Att_Employee_Name

Nod_<3rdTableName>

Att_Employee_Name

Nod_<4thTableName>

Att_Employee_Name

I hope you understand what I meant. You can also follow the coding & designing standards. Always better to use structured programming style.

Regards

Chander Kararia

# Please close the thread once get the correct answer. Give rewards for answers.