Subscribe: Architecture
http://forums.asp.net/rss.aspx?ForumID=16&Mode=0
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
application  architecture  code  data  database  net  new  object  order  public  repository  servicetype  void singleton  void 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Architecture

Architecture



Discuss and debate ASP.NET application designs.



Last Build Date: Mon, 20 Mar 2017 15:02:56 -0700

 



Security on Angular/WebApi with OAuth backend services

2017-03-27T10:27:58.593-07:00

Hi all,

I'm currently working on an Application which relies heavily on OAuth2 REST Services. 
And I'm looking for some advice on the security part.

To minimize the work and actions for the end-clients I would prefer a Single sign-on solution 
And re-use the tokens I receive from the REST service for my own security.

In short; client authorizes my App to use the REST services and retrieves an access+refresh token.
On the callback I keep all info together to create the Account (ASP.NET Identity) in my Db and set the tokens as Claims.
And I re-use the same access/refresh tokens to secure my WebApi and also use them to forward to the REST service.

Would this make sense? Or any other ideas? 
I would like to keep my work/custom code as limited as possible.
So any links/tips are more than welcome.




layred application mvc sales order and linq to entity

2017-03-11T15:02:31.903-08:00

hello

i'm beginner in repository and layerd application. and  i don't inderstand well which is the interaction and the relationship between the repositories and business layer classes.

 I have a confusion between both them

Here is an example for purchaese order in 3 layers and I want to review whether correct or not, and your correction

for DataAcesslayer

repository OrderRepositolry

Namespece Dal
    {
       Public class RepositoryOrder
       {
              POrderContext context = new POrderContext ();
 
              Public IEnumrebale  GetAll ()
              {
                   Context.Orders;
              }
// Following code
       }
    }

for the item of order repositories code :

namespece Dal
{
      public class RepositoryOrderItem
      {
             POrderContext context = new POrderContext();

             public IEnumrebale GetAllItemById(Order o)
             {
                  context.OrderItems.where(i => i.OrderId == o.Id);
             }

            public OrderItem GetItemById(int id)
            {
                 context.OrderItems.Find(id);
            }
//Following code
      }
}

for businessLayer here is classOrderBLL code:

namespace BLL
{
      public class OrderBLL
      {
            RepositoryOrder repoOrder = new RepositoryOrder();
            RepositoryOrderItem repoItem = new  RepositoryOrderItem();

            public IList GetAll()
           {
               return repoOrder.GetAll();
           }

            public decimal GetPrixTotal(Order order)
           {
                var query = from item in repoItem.GetAllItemById(order)
                                 select sum(item=>item.Prix * item.Quantite);
                return query;
            }
      }  
}
  1. does the total price calculation is done at the level of repository or at the level of BLL (we can make this request linq with context in the repository)?

  2. CRUD method is done at repository and they are called at BLL from repository is it right?

  3. The where extension method or the where clause in the linq to entity query matches the business rule (will be implemented at BLL) or corresponds to the read data acess (at the repository level).

Any help, advice and good practice will be welcome

have a good day




Best layer to handle exceptions, convertions and custom errors in three tire architecture in asp.net three tire application?

2017-03-21T06:23:03.7-07:00

My architecture design:

Front end(UI): Web-services, asp.net web-forms, jQuery.

BLL: Business logic.

DAL: Accessing database.

I have classes for each table in database.

Q1. I am using date format  that is different from database. Should I handle this in BLL or UI(Web-service or jQuery)?

Q2. I have unique key for my mail-id column. If user tries to insert/update I will check for unique. I not unique I want to say user to enter unique. Now I access DAL for unique from BLL and call DAL for update/insert according to result. Now should I handle this custom errors in BLL and send error message to jQuery in JSON string or in UI(Web-service or jQuery)?

Q3. When exceptions occurs I am just throwing and handling them in jQuery error section. Is this right or should I handle them in BLL and send error messages in form of JSON string to jQuery?

I consider doing all these stuff in BLL because it is where we will have all the converting logic's like readers into objects. Am I wrong?




sales order & linq to entity

2017-03-11T13:38:37.163-08:00

hello

i'm beginner in repository and layerd application. and  i don't inderstand well which is the interaction and the relationship between the repositories and business layer classes.

 I have a confusion between both them

Here is an example for purchaese order in 3 layers and I want to review whether correct or not, and your correction

for DataAcesslayer

repository OrderRepositolry

Namespece Dal
    {
       Public class RepositoryOrder
       {
              POrderContext context = new POrderContext ();
 
              Public IEnumrebale  GetAll ()
              {
                   Context.Orders;
              }
// Following code
       }
    }

for the item of order repositories code :

namespece Dal
{
      public class RepositoryOrderItem
      {
             POrderContext context = new POrderContext();

             public IEnumrebale GetAllItemById(Order o)
             {
                  context.OrderItems.where(i => i.OrderId == o.Id);
             }

            public OrderItem GetItemById(int id)
            {
                 context.OrderItems.Find(id);
            }
//Following code
      }
}

for businessLayer here is classOrderBLL code:

namespace BLL
{
      public class OrderBLL
      {
            RepositoryOrder repoOrder = new RepositoryOrder();
            RepositoryOrderItem repoItem = new  RepositoryOrderItem();

            public IList GetAll()
           {
               return repoOrder.GetAll();
           }

            public decimal GetPrixTotal(Order order)
           {
                var query = from item in repoItem.GetAllItemById(order)
                                 select sum(item=>item.Prix * item.Quantite);
                return query;
            }
      }  
}
  1. does the total price calculation is done at the level of repository or at the level of BLL (we can make this request linq with context in the repository)?

  2. CRUD method is done at repository and they are called at BLL from repository is it right?

  3. The where extension method or the where clause in the linq to entity query matches the business rule (will be implemented at BLL) or corresponds to the read data acess (at the repository level).

have a good day




Mulitenant with dependancy Injection and IOC + Unity.MVC5

2017-03-20T13:42:30.92-07:00

Hi,

 As per requirement we need to create single instance multiple database application using the same enterprise architecture.

We have following requirements.

1. We have single database architecture and followed the UOW architecture as mentioned in link https://www.codeproject.com/articles/990492/restful-day-sharp-enterprise-level-application
2. Create a client specific database which will have clients data only. Means One application will have multiple databases.
3. Need to manage client specific connection string with UOW architecture

Thanks in advance




MVC with Angular JS or ASP .Net

2016-12-23T05:28:53.717-08:00

Hi friends,

I need to implement a project in Angular JS 2.0 , there is no mention by the client to use classic ASP.Net or MVC.

My problem is I am new to Angular as well as MVC. I wanted to know if I can use Angular with classic ASP.Net  (this will be simpler for me)  or there are constraints in this design?

I also wanted to know, how useful / easy will it be to use MVC with angular by learning it. Project will kick off in January 1st week.




How do you draw the relationship between a workflow table and the request order?

2017-02-19T10:55:39.507-08:00

Hi expert,

I am requested to come up with the database schema with relationship between tables.

Now, using the reference database, there is this workflow table which contains as follows:

ePMT_Workflow

ID int PK, not null
Status (varchar(50), not null
next-Status (varchar(50), not null
Workflow_TaskID(int, null)
Next_Workflow_TaskID(int, null)
Action(varchar(50), null)
Description(varchar(100),null)

And then this status also appears in my RequestOrder Table.

But, I can't put Status as my Foreign Key in my RequestOrder Table right ?

How should I draw the line between these 2 tables ? It is many to 1 but I am stuck cos the PK - ID doesn't appear in the Request Order Table.

Hope to get some advice. Tks.




How to set up a website for offline work for multiple users

2017-02-19T09:36:30.9-08:00

Here's an example of what I'm trying to do.

Let's say I've made a fx trading bot that uses a fx brokers website, queries the prices, and submits trades according to settings specified. It runs fine in a console application from my raspberry pi.

Now I would like to commercialize it in a website where I can have multiple users running their own instance of the bot with their own settings and have each bot run 24/7.

I'm having trouble conceptualizing the design of it to accomplish the constant, individual running of bots from a website. Each user running on it's own thread? Thread sharing? Anybody have some pointers?

I've done windows forms but not websites, and I haven't done things that require it to run even when the user isn't on it.




Windows Workflow Foundation, Sendgrid or an other for send emails.

2017-02-24T18:40:14.713-08:00

I'm building an application that will need to send e-mails and approval emails constantly. 

Should I use Sendgrid with a bus, WF or an other api?




Methodology for updating server side lists

2017-02-22T22:06:54.29-08:00

I am currently writing a ASP.Net web application that has a section for out IT department to manage users. One of the things it will do is give a checkbox list of the active directory security groups and email groups a user can be a member of. I was easily able to work out the code needed to add a user to a group when the use is first created. Now I am trying to figure out an efficient way to update the groups when a user changes, for instance the user is part of 5 groups and IT updates them to add a new group and remove them from 2 existing groups.

I have thought about just doing a blanket remove from all the groups then go back and add them back to the selected ones. I have also thought of querying to get a list of all the groups they are in now, doing a compare to a list of the selected groups, calculating out which ones where removed and which where added then doing the appropriate calls. Both these methods do not seem very efficient and potentially process intensive.

What is the more common ways a skilled/experienced developer deals with this kind of situation?




Enterprise Architecture - Question/Feedback/Suggestions

2017-02-23T02:36:04.99-08:00

We work at a very large global enterprise.  We have built numerous .NET applications using framework 4.0 and 4.5.2. 

Our business team wants us to provide them a "platform" like application. One where they can create forms and collect data. One where they can "drag & drop" workflows for these custom forms they build, all from the UI. Thus alleviating the need to have the technology team build a new app every time they need a form to collect data. They want everything to be API based, so that we can possibly allow external or internal third parties to consume and leverage the application/platform we build. They are basically trying to evaluate build VS buy. Does it make sense to build up and advance our existing apps to provide this functionality or do we buy a product off the shelf.

If we do go down the build path, our technology stack of choice is going to be .NET CORE. This will allows us to leverage a lot of our existing code base and reuse it. We will most likely use Angular or MVC Hybrid as the frontend UI.

Question:

We know how to create a dynamic form build with pure .NET code, as we have done that before. Are there any open-source plugins or tools that we can use with our .NET Core code that would allow us to easily offer the form builder and dynamic workflow builder to the business team. Are there any small JS libraries that could make this capability simpler for us to build. Rather than us build the entire functionality from the ground up.

Any and all suggestions are most welcome! (image)




Best practice to override global data with region data

2017-02-07T01:55:53.357-08:00

I have a music store application and it is used in various locations. Most of the locations have same defaults but there exist few remote regions with regional specifics and need to overwrite the defaults. Details below 
Global defaults:
Default Language = English
Popular Music = Pop
etc

Remote1 defaults:
Default Language = Spanish
Popular music = Rap

Remote2 defaults:
Default Language = Italian
Popular music = Jazz

When a Music store user logs in to the app, by default the global data is loaded into the class and then verify if user's data has to be overridden with his regional specifics. I could do this simply by loading the global defaults and then verify if the user has local specifics and then overwrite the global defaults using simple sequence of statements and if conditions. But curious to know if I could use a best OO pattern. 




Onion architecture is same as domain driven design pattern or is it totally different ?

2017-01-24T09:44:42.83-08:00

please have a look at two links

http://www.c-sharpcorner.com/article/onion-architecture-in-asp-net-core-mvc/

https://www.codeproject.com/Articles/808400/Onion-Architecture-in-ASP-Net-MVC

i read article from those links and i feel Onion architecture is same as domain driven design pattern. so please some one tell me am i right ?

thanks




Manage Unit Test with Complex Architechture

2017-02-03T11:40:51.04-08:00

Hi Experts,

I have attached overview of my application architecture (https://www.imageupload.co.uk/image/BkAE).

I have web application which is dependent on few of window application.Following are process steps.

1)Create request for process (win. appl 1) and store it into database.
2)Scheduler pick this request from database.
3)Scheduler invoke respective window application.
4)Window application process and update database.
5)Web get updated status from database and requred tables

Now, I have unit test project for web application.How can i make test case for this.

What are the standard options?

(image)




Real-time Extraction of Data from Access DB

2017-01-24T12:39:32.53-08:00

Good day all,

I am about to implement a solution for a Bank, the solution is to read/extract transaction details from an ATM and read same into a database, numbered below is the workflow, I am not just sure of the best architecture to impose.

  1. The Bank has about 1,000 ATMs, connect to each ATM at 30 Minutes interval and move each Journal file from the ATM directory to a specific and centralized location.
  2. The Journal files are in ACCESS DB format.
  3. The file numbering system in the directory grows by size, so its possible to find only one file in a terminal but find up to 3 files in another terminal
  4. Read through each file and extract its record to a Database table
  5. The read/write of these records to the database is meant to be almost real-time (about 30mins delay the least), so its possible that the same file read in the first throughput is read again, however, only unique records should be imported into the database table.

I can clarify further if there are grey areas, thank you.




Entities and POCO objects

2017-01-17T21:42:32.893-08:00

Hi all,

I want to ask you for a help. Two software solutions I'am working on are implemented using ado.net, and N-layered architecture.

But, I can not understand that we use data objects (poco classes) to fill it using data reader, and the same objects we use in web api and angular application.

There are no any other models in solution. What you are think about that and how we can improve our solution?




Code explanation

2017-01-15T23:20:19.503-08:00

Does anyone can explain  me code below. I inherited application and found this piece of code, but it is not clear for me. public interface IAppServices : IServiceProvider, IDisposable { bool IsRegistered(Type serviceType); bool IsRegistered(); void Register(Type serviceType, Func serviceFactory); void Register(Type serviceType, Type implementationType); void Register(Func serviceFactory); void Register(); void Singleton(Type serviceType, Func serviceFactory); void Singleton(Type serviceType, Type implementationType); void Singleton(Type serviceType, object serviceInstance); void Singleton(Func serviceFactory); void Singleton(); void Singleton(TService serviceInstance); } and interface implementation public class AppServices : Disposable, IAppServices { private object m_syncObject; private IDictionary> m_factories; private IDictionary m_instances; public AppServices() { m_syncObject = new object(); m_factories = new Dictionary>(); m_instances = new Dictionary(); } protected override void OnDispose() { m_factories.Clear(); foreach(var kvp in m_instances) { if (kvp.Value is IDisposable) (kvp.Value as IDisposable).Dispose(); }; m_instances.Clear(); base.OnDispose(); } public void Singleton(Type serviceType, object serviceInstance) { ArgumentsGuard.NotNull(serviceType, "serviceType"); ArgumentsGuard.NotNull(serviceInstance, "serviceInstance"); Register(serviceType, (provider) => { m_instances[serviceType] = serviceInstance; return serviceInstance; }); } public void Singleton(Type serviceType, Func serviceFactory) { ArgumentsGuard.NotNull(serviceType, "serviceType"); ArgumentsGuard.NotNull(serviceFactory, "serviceFactory"); Register(serviceType, (provider) => { object instance = serviceFactory(provider); m_instances[serviceType] = instance; return instance; }); } public void Singleton(Type serviceType, Type implementationType) { ArgumentsGuard.NotNull(serviceType, "serviceType"); ArgumentsGuard.NotNull(implementationType, "implementationType"); Register(serviceType, (provider) => { var ctor = implementationType.GetConstructors().Single(); var parameterTypes = ctor.GetParameters().Select(p => p.ParameterType); var dependencies = parameterTypes.Select(t => provider.GetService(t)).ToArray(); var instance = Activator.CreateInstance(implementationType, dependencies); m_instances[serviceType] = instance; return instance; }); } public void Regist[...]



Combining Nodejs with ASP.NET for a scalable architecutre.

2017-01-15T14:12:42.52-08:00

Hello, i am a student, i am working in another domain then programming, i would like to hear your thoughts about this.

I need to build a highly scalable website, actually i need it to be as cheap as possible since my cash reserves are rather limited.

Apart from various caching strategies and so forth, here is one strategy i want to implement.

I will have 2 separate sites.

One will be a NodeJs powered website, that will serve static content (scripts, css, angular 2, have webpack running on it).I want to have it NodeJS because i want to learn a bit about Node in the process, and it is really hard to work with Angular 2/typescript enviromnent in visual studio for me.( some will disagree and thats fine ).

The other will be a ASP.NET WEB API 2 powered website, which will only expose some endpoints for the nodejs application to consume data.

Both will be hosted in Microsoft Azure's Web Apps.

Is this a good idea? are there any drawbacks, what do you guys think?

I understand Node runs on a single thread as javascript does.If i have a 2 cpu machine on Azure, will Node run on those 2 cpus as different instances, or will it just use one thread and the other cpu will stand by idly.




Implementing Strategy Design Pattern

2017-01-17T11:16:37.4-08:00

I'm trying to use the Strategy pattern to calculate the pay of Salaried employees, Hourly employees, Contract employees etc. 

Below is how I implement the Strategy pattern.

public class Employee
{
    public string Name { get; set; }    
}

public class HourlyEmployee: Employee
{
    public double HoursWorked{ get; set; }
    public double HourlyRate{ get; set; }
    public HourlyEmployee(string name, double hours, double rate)
    { Name = name; HoursWorked = hours, HourlyRate = rate;}
}

public class SalariedEmployee: Employee
{
    public double MonthlyPay{ get; set; }
    public SalariedEmployee(string name, double rate)
    { Name = name; MonthlyPay = rate}
}

public interface ICalculatePayStrategy
{
    double CalculatePay(Employee employee);
}
public class HourlyEmployeePayStrategy: ICalculatePayStrategy
{
    double CalculatePay(Employee employee)
    {
        HourlyEmployee hourlyEmp = employee as HourlyEmployee;
        if(hourlyEmp == null)
        return 0;
        return hourlyEmp.HoursWorked* hourlyEmp.HourlyRate;
    }
}

public class SalariedEmployeePayStrategy: ICalculatePayStrategy
{
    double CalculatePay(Employee employee)
    {
        SalariedEmployee salariedEmp = employee as SalariedEmployee;
        if(salariedEmp == null)
        return 0;
        return employee.MonthlyPay;
    }
}

public class PaymentService
{
   private ICalculatePayStrategy payStrategy;
   public PaymentService(ICalculatePayStrategy strategy)
   {
       ICalculatePayStrategy = strategy;
   }
   
   public double GetEmployeePay(Employee employee)
   {
      return payStrategy.CalculatePay(employee);
   }
}

 Please let me know if my code above implements the Strategy design pattern correctly. Also is this an ideal scenario for using the Strategy pattern?




Need some books or any tutorial for software architecture

2017-01-16T09:35:39.37-08:00

Hi All Architects,

Can someone suggest any good guide/tutorial for software architectural design.

Thanks,

Harsh