• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

distinction between facade and model

 
estoy Qiu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eugene
I have read the brilliant post of you and mark about gui design with MVC . your suggestion that facade and model be seperate seems very reasonable and I try to follow it. In my original design,the facade acts as a model.
Now I divided it into two classes: facade is to provide access to database such as methods close(), getSchema(), and getAllRecords(),getUniqueFieldData() and the model whose responsibilty is to implement business methods such as bookFlight() and searchFlights(),getAllFlights(),getArrivalAirports()..
Now I have a question, in my bookFlight() method I called such methods as lock(),unlock(),modify(),find().. from dataAccessor,which is created by DataAccessFactory to get a reference of local/remodate database. Becasue only my facade uses dataAccessor, It seems I should wrap the methods including lock(),unlock(),modify() again in the facade class so that my model business methods can use them?
Is there another way around? I am quite confused now. Pls. help me out
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"model business methods"
Isn't that a contradiction? The Model to me is the data values. No business methods at all.
Mark
 
estoy Qiu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi mark:
sorry i didn't get it. Does your model means the table model? I was talking about the app level Model.I once took facade as Model
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic