0

I'm a bit stuck on the Onion Architecture.

Say I'm developing an application where a user can register an account, log in and maintain their account(E.G. Change Phone Number).

However, while they are logged in, they can do other application stuff (E.G. Create products, add blog entries, send messages with photos attached etc...)

I'm struggling to define business logic and here is why.

All application services gets saved into a Postgresql Database.

All User management functions and logging into their account gets handled by LDAP 389 Directory Server. I will be using the Novell.Directory.Ldap Package as this will be running on mono and there is no support yet for System.DirectoryServices.Protocols

Both the application database and the Directory server have unique tables.

Do I put both the Application Database Entities and the LDAP Directory Service Models in the App.Domain.Entities?

Technically speaking I have 2 different types of databases with different types of models.

Not entirely sure how to approach this one.

My Solution Structure:

  • Domain
    • App.Domain.Entities
    • App.Domain.Interfaces
  • Infrastructure
    • App.Infrastructure.Data (FluentNHibernate)
    • App.Infrastructure.DependecyResulution (SimpleInjector)
    • App.Infrastructure.Interfaces
    • App.Infrastructure.Logging (NLog)
    • App.Infrastructure.LDAP (Novel.Directory.Ldap)
  • Services
    • App.Services.Interfaces
  • Web
    • App.Web.UI (ASP.NET MVC 4 Razor)

I'm pretty sure I'm doing it wrong. Can someone please point me in the right direction with some sort of pseudo example. e.g. Where does the models go etc.

Thank you in advance

Shane van Wyk
  • 1,870
  • 1
  • 26
  • 62

1 Answers1

1

For Single Sign On Applications, you probably want to move all of the Security out into a Separate Service that works directly with your LDAP Provider. That way you are not tightly coupling Product Specific LDAP Code into your Web Application. Your Web App can then call the Security Service passing it the Login Credentials of the User who is signed into the OS. That way if you're needing to grant permissions to Groups of User or Users, you can just be returned a boolean from the Security Service of whether that Logged in User is Authorized.

Eddie
  • 466
  • 5
  • 8
  • I'm still a bit confused. As the single sign on application is not used to just sign on, they can also alter their details / maintain the account. I'm just not sure if the LDAP entities need to go into the Domain or if the whole implementation to communicate with LDAP has to go in it's own unique project. – Shane van Wyk Jan 07 '15 at 03:29
  • My suggestion is to put the LDAP stuff into its own unique project. – Eddie Jan 13 '15 at 20:25