• Post Reply Bookmark Topic Watch Topic
  • New Topic

B&S: Data class vs BodgittScarperData class

 
Surya De
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello fellow ranchers,

Here is my question. I have been reading a couple posts where you ranchers mention the Data and the BodgittScarperData class. Now as of right now I only have a Data class implementing the DB class. Where does this BodgitScarperData class fit in? Is this supposed to be the class that does the reading from the file and population of a collection class with all the Contractor records from the db flatfile? I am quite confused right now. Any thoughts would help me out a lot. I am able to get the UI showing the records on when there is no network connection. I think I am missing something fundamental that would enable me to fix the RMI stuff as well.

Cheers,
Surya
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12056
232
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Surya,

I think the BodgittScarperData class has mainly been mentioned as a way of illustrating a point (that business logic should not be in the Data class). I don't think that that the BodgittScarperData is something that is being regularly implemented, or that there is common functionality in such a class by those who do coincidentally have such a class.

The BodgittScarperData usually comes up in a discussion similar to:
  • person A: should my Data class' update method check whether the owner field is already in use
  • person B: whoa there - it sounds like you are making a Data class that is specific to Bodgitt and Scarper (or URLyBird), and not a generic Data class. Consider the supplied methods of the interface you have been given - nothing in them is specific to the assignment: you could use the same interface for a data file containing addresses or a data file containing billing details or .... If you include the check on the owner field in the Data class' update method then you are making a Data class that can only handle Bodgitt and Scarper data - in effect a BodgittScarperData class.
  • Person A: oh!
  • Of course, I could be wrong about the way it is described - there are undoubtably people who are creating a BodgittScarperData class that wraps Data class and ensures business logic requirements are met (possibly only exposing business logic methods). But I dont think that the BodgittScarperData class is commonly used, and if you don't need it, don't implement it.

    Regards, Andrew
     
    What are you doing? You are supposed to be reading this tiny ad!
    the new thread boost feature brings a LOT of attention to your favorite threads
    https://coderanch.com/t/674455/Thread-Boost-feature
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!