DDD Best practices [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I'm developing some test web-project for my self to learn DDD and good architectural practice at all. So application, basically, is a simple photo manager.



I'm developing 3-tier architecture and for now I have:



  • DAL:

    • EF database first

    • UserRepository

    • PhotoRespoitory

    • UnitOfWork



  • BLL



    • UserService: user registration, authentication, registration

    • PhotoService: photo retrieving, uploading, updating

    • DTO Models: User, Photo, Album

    • Automapper: mapping DAO from EF to DTO model


  • Asp.Net MVC Client


Here are examples of DTO models:



public abstract class ModelBase

public virtual long Id get; protected set;


public class User : ModelBase

public string Name get; set;
public string Email get; set;
public UserRole UserRole get; set;
public DateTime RegistrationDate get; set;

public override string ToString()

return $"Name Email UserRole RegistrationDate";




public class Photo : ModelBase

public string Name get; set;
public DateTime DateTaken get; set;
public string Place get; set;
public string CameraModel get; set;
public string FocalLength get; set;
public string Diaphragm get; set;
public string ShutterSpeed get; set;
public string ISO get; set;
public bool? FlashMode get; set;
public long OwnerId get; set;
public string OwnerName get; set;
public long AlbumId get; set;
public string AlbumName get; set;



So my questions are:



1) Does it make sense to create domain models with some logic, as model manipulation logic was delegated to service?



2) Is BLL the right place for DTO models?



3) Do I need to create an additioanl ApplicationService, that will contain PhotoService and PhotoService and finds user that uploads picture and then pass the UserDto with PhotoDto to PhotoService?







share|improve this question











closed as primarily opinion-based by IEatBagels, yuri, t3chb0t, Stephen Rauch, Ludisposed Jul 31 at 17:19


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.




















    up vote
    1
    down vote

    favorite












    I'm developing some test web-project for my self to learn DDD and good architectural practice at all. So application, basically, is a simple photo manager.



    I'm developing 3-tier architecture and for now I have:



    • DAL:

      • EF database first

      • UserRepository

      • PhotoRespoitory

      • UnitOfWork



    • BLL



      • UserService: user registration, authentication, registration

      • PhotoService: photo retrieving, uploading, updating

      • DTO Models: User, Photo, Album

      • Automapper: mapping DAO from EF to DTO model


    • Asp.Net MVC Client


    Here are examples of DTO models:



    public abstract class ModelBase

    public virtual long Id get; protected set;


    public class User : ModelBase

    public string Name get; set;
    public string Email get; set;
    public UserRole UserRole get; set;
    public DateTime RegistrationDate get; set;

    public override string ToString()

    return $"Name Email UserRole RegistrationDate";




    public class Photo : ModelBase

    public string Name get; set;
    public DateTime DateTaken get; set;
    public string Place get; set;
    public string CameraModel get; set;
    public string FocalLength get; set;
    public string Diaphragm get; set;
    public string ShutterSpeed get; set;
    public string ISO get; set;
    public bool? FlashMode get; set;
    public long OwnerId get; set;
    public string OwnerName get; set;
    public long AlbumId get; set;
    public string AlbumName get; set;



    So my questions are:



    1) Does it make sense to create domain models with some logic, as model manipulation logic was delegated to service?



    2) Is BLL the right place for DTO models?



    3) Do I need to create an additioanl ApplicationService, that will contain PhotoService and PhotoService and finds user that uploads picture and then pass the UserDto with PhotoDto to PhotoService?







    share|improve this question











    closed as primarily opinion-based by IEatBagels, yuri, t3chb0t, Stephen Rauch, Ludisposed Jul 31 at 17:19


    Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm developing some test web-project for my self to learn DDD and good architectural practice at all. So application, basically, is a simple photo manager.



      I'm developing 3-tier architecture and for now I have:



      • DAL:

        • EF database first

        • UserRepository

        • PhotoRespoitory

        • UnitOfWork



      • BLL



        • UserService: user registration, authentication, registration

        • PhotoService: photo retrieving, uploading, updating

        • DTO Models: User, Photo, Album

        • Automapper: mapping DAO from EF to DTO model


      • Asp.Net MVC Client


      Here are examples of DTO models:



      public abstract class ModelBase

      public virtual long Id get; protected set;


      public class User : ModelBase

      public string Name get; set;
      public string Email get; set;
      public UserRole UserRole get; set;
      public DateTime RegistrationDate get; set;

      public override string ToString()

      return $"Name Email UserRole RegistrationDate";




      public class Photo : ModelBase

      public string Name get; set;
      public DateTime DateTaken get; set;
      public string Place get; set;
      public string CameraModel get; set;
      public string FocalLength get; set;
      public string Diaphragm get; set;
      public string ShutterSpeed get; set;
      public string ISO get; set;
      public bool? FlashMode get; set;
      public long OwnerId get; set;
      public string OwnerName get; set;
      public long AlbumId get; set;
      public string AlbumName get; set;



      So my questions are:



      1) Does it make sense to create domain models with some logic, as model manipulation logic was delegated to service?



      2) Is BLL the right place for DTO models?



      3) Do I need to create an additioanl ApplicationService, that will contain PhotoService and PhotoService and finds user that uploads picture and then pass the UserDto with PhotoDto to PhotoService?







      share|improve this question











      I'm developing some test web-project for my self to learn DDD and good architectural practice at all. So application, basically, is a simple photo manager.



      I'm developing 3-tier architecture and for now I have:



      • DAL:

        • EF database first

        • UserRepository

        • PhotoRespoitory

        • UnitOfWork



      • BLL



        • UserService: user registration, authentication, registration

        • PhotoService: photo retrieving, uploading, updating

        • DTO Models: User, Photo, Album

        • Automapper: mapping DAO from EF to DTO model


      • Asp.Net MVC Client


      Here are examples of DTO models:



      public abstract class ModelBase

      public virtual long Id get; protected set;


      public class User : ModelBase

      public string Name get; set;
      public string Email get; set;
      public UserRole UserRole get; set;
      public DateTime RegistrationDate get; set;

      public override string ToString()

      return $"Name Email UserRole RegistrationDate";




      public class Photo : ModelBase

      public string Name get; set;
      public DateTime DateTaken get; set;
      public string Place get; set;
      public string CameraModel get; set;
      public string FocalLength get; set;
      public string Diaphragm get; set;
      public string ShutterSpeed get; set;
      public string ISO get; set;
      public bool? FlashMode get; set;
      public long OwnerId get; set;
      public string OwnerName get; set;
      public long AlbumId get; set;
      public string AlbumName get; set;



      So my questions are:



      1) Does it make sense to create domain models with some logic, as model manipulation logic was delegated to service?



      2) Is BLL the right place for DTO models?



      3) Do I need to create an additioanl ApplicationService, that will contain PhotoService and PhotoService and finds user that uploads picture and then pass the UserDto with PhotoDto to PhotoService?









      share|improve this question










      share|improve this question




      share|improve this question









      asked Jul 31 at 13:46









      Alexander Smith

      61




      61




      closed as primarily opinion-based by IEatBagels, yuri, t3chb0t, Stephen Rauch, Ludisposed Jul 31 at 17:19


      Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.






      closed as primarily opinion-based by IEatBagels, yuri, t3chb0t, Stephen Rauch, Ludisposed Jul 31 at 17:19


      Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.



























          active

          oldest

          votes






















          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Greedy Best First Search implementation in Rust

          Function to Return a JSON Like Objects Using VBA Collections and Arrays

          C++11 CLH Lock Implementation