Question

I read the following really good and informative article on MVP: MVP Building from scratch.

Referring to the below architecture diagram (taken from the post):

  1. i wanted to know if the model classes defined in the presentation layer will be shared in the BLL layer as well. Should these classes form part of separate project which will then be referenced in the BLL.
  2. Also will not the service layer user the model class to transfer data to & from the BLL.

enter image description here

Was it helpful?

Solution

Depending on your architecture. You are referring to mobile object (not mobile device) or simply entity.. its possible if you place it in your common project/library that can reference by your BLL, DAL, and other projects like your service… there are certain rules when grouping common objects, be sure objects in common lib are very basic objects and helper classes, NO UI library references because this will break the essence of your common library.

If your BLL, DAL, has constraint referencing the Entity (this happens when you place your entity object in your BLL or DAL), create interface of that entity and place it in your common library and use this as parameter instead of entity object…

On service, I use interface for mocking… Interface allows you to do horizontal testing (mocking) because you could create mock objects using interface...

Hope I answer your questions…

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top