Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Defining roles in the application

 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ALL,

My application will have typically 7-8 types of users. The contents of the pages will be dynamically generated based on the role of the user logged in.

I've to decide between 2 types of approaches :-

1) Storing the details in DB
2) Storing the details in xml.

CAn anyone tell me the advantages and disadvantages of these 2 approaches? and which approach should i follow?

Grishma
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It makes no difference - both are just places to persist stuff. So it depends which makes more sense in the context of your application. If you are already using the DB, then it makes sense to put role information there, if not, then an XML file might be a good idea.
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Paul.

But I want to know which is a preferred way. Suppose I go for XML file to store this information. Do we have any advt or disadvt over DB.

TIA

Grishma
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't a prefered way - only different ways of doing this. The only disadvantage of using XML and a DB, is you will have application data in two places, not one. There isn't an advantage I can think of.
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each situation and person is different. Your skillset may determine which is the preferred approach for you. Which storage medium is more easily modified? Does your application require frequent role modifications? How does this affect your preference?

Which has more buzzwords? This may affect marketing's preference.
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK...Thanx
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyother views........
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Grishma,
I agree with Paul and David - this is entirely a matter of personal preference. Having said that, here's mine:

If different data is displayed for different roles, store it in the database. If different layout/items are displayed for different roles, store it in the XML.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic