Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

B&S: Do you show the Flag field and what is really meant by it?

 
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

my assignment (B&S 2.1.3) says about the flag field in the data file format description:

1 byte flag. 00 implies valid record, 0xFF implies deleted record



I have some questions regarding the flag field

  • Do you show the flag field in your view?
  • How does your flag field looks after you book?
  • Are there other values than 00 and 0xFF allowed?
  • Do we expect that the customer set only 00 and 0xFF in his provided data file?


  • Answers are very welcome

    Regards,
    Darya
    [ April 15, 2005: Message edited by: Darya Akbari ]
     
    Ranch Hand
    Posts: 442
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I don't have the same assignment but this should apply, better double check though.

    1) No, on the grounds that any record marked as deleted will not be read, so everything in the view has not been marked as deleted.
    2) Unaffected
    3) No
    4) The user has no access to that value.
    [ April 15, 2005: Message edited by: Ta Ri Ki Sun ]
     
    Darya Akbari
    Ranch Hand
    Posts: 1855
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Ta Ri,

    Sounds good.

    Regards,
    Darya
     
    Darya Akbari
    Ranch Hand
    Posts: 1855
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    But aren't we supposed to implement the delete method public void delete(int recNo, long lockCookie)

    In that case we need to access the data file to update the flag and to make the model persistant. And yes, I mean a physical write to our given data file.

    We can implement the delete method and its flag setting, however we don't have a use case Delete Records in our assignment. So maybe we can also provide a dummy implementation of delete.

    Regards,
    Darya
    [ April 16, 2005: Message edited by: Darya Akbari ]
     
    Ranch Hand
    Posts: 357
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Originally posted by Darya Akbari:
    We can implement the delete method and its flag setting, however we don't have a use case Delete Records in our assignment. So maybe we can also provide a dummy implementation of delete.



    Hi Darya,

    I think that is a risky route to take. You are required to implement the interface and it could be argued that a dummy implementation is not an implementation. Leaving out delete avoids some of the potential concurrency problems, so it could be perceived by the assessor as taking a shortcut.

    If you do make a dummy implementation, document your choice in choices.txt thoroughly.

    In case you decide to implement delete after all, you indeed need to update the file to change the flag.
    The remarks made above are correct: you don't show the deleted flag anywhere in your GUI: you only show records that are not deleted.

    Frans.
     
    Darya Akbari
    Ranch Hand
    Posts: 1855
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Frans,

    it's always good to hear from you . Ok, for the the sake of concurrency and the fact that one may to add a delete record to the view I will implement the delete function.

    Thanks,
    Darya
     
    Frans Janssen
    Ranch Hand
    Posts: 357
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Originally posted by Darya Akbari:
    Ok, for the the sake of concurrency and the fact that one may to add a delete record to the view I will implement the delete function.



    A wise decision!
     
    Darya Akbari
    Ranch Hand
    Posts: 1855
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    That's why I'm here, to collect wisdom
     
    We begin by testing your absorbancy by exposing you to this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!