Android Question Header/Details - best practice to store

Discussion in 'Android Questions' started by Bobi, Jun 29, 2015.

  1. Bobi

    Bobi Member Licensed User

    What is the best practice to work with Header/Details document structure from real world (using for example type)?
    Code:
    Type Order (id_order As Int, od As OrderDetail)
    Type OrderDetail (id_orderdetail, id_order As Int)
    This is not a solution because i have there a one-to-many relation.

    Thank you
     
  2. eurojam

    eurojam Well-Known Member Licensed User

    This sounds like a database solution where you can easily manage 1:many relations. If you want to make it without a database, i would choose a list:
    Code:
    Type Order (id_order As Int, OrderDetailList As List)
    where you put the details in the list of your type....
     
    Bobi likes this.
  3. Bobi

    Bobi Member Licensed User

    So do you suggest to append (type of) OrderDetails to list. Seems to be a nice aproach.
     
  4. eurojam

    eurojam Well-Known Member Licensed User

    yes, but I would regard the database as the first choice.
     
  5. Bobi

    Bobi Member Licensed User

    Sure. But not in my case. All information resides in a database behind an web services. Mobile application is just a ... window where I can see/manipulate data. It's not working "offline" so I don't need to store data. Hope puting some information in memory it's not a tragedy :D
     
Loading...