Subscribe: Architecture
http://forums.asp.net/rss.aspx?ForumID=16&Mode=0
Added By: Feedage Forager Feedage Grade A rated
Language: English
Tags:
angular  application  data  net  new  object  project  public  service  servicetype  void singleton  void  web api  web 
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: Tue, 03 Jan 2017 07:02:19 -0800

 



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.




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




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 Register(Type serviceType, Func serviceFactory) { ArgumentsGuard.NotNull(serviceType, "serviceType"); ArgumentsGuard.NotNull(serviceFactory, "serviceFactory"); lock (m_syncObject) { if (IsRegistered(serviceType)) throw new ArgumentException(&q[...]



Handling assembly references in ASP.NET Core

2017-01-10T15:21:08.6-08:00

Hi,

     Just want to check on something, its about handling assembly references in ASP.NET Core. For example I have an ASP.NET Core Web API project that depends on another project say a class library called Service, this Service project in turn depends on a class library for example called Data. The intention is to reference only the service project in the ASP.NET Core Web API project so that anyone who works on that project will not be able to access implementation details that are on the Data project. 

       But currently, looking at how ASP.NET Core handles references, it seems that it also includes all the references 'underneath'. In the snapshot below, I only added a reference to the Service Project, but it seems that it also sees the Data Project (which is not my intention at all). Checking in the actual code, I am able to access the Data project (without performing an add reference operation), just want to ask if there is a way to disable this behaviour? Normally we won't be able to reference anything on a project without adding it explicitly as a reference, but in this case, I just added reference to Service and it seems that it automatically added a reference to the Data project as well.

       Is there any way to avoid this behaviour in ASP.NET Core? I mean not entirely but disable it only when adding references to projects in the solution.

Thanks!

Jude Alquiza.




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.




Metadata driven architecture

2017-01-02T05:49:43.61-08:00

Need advice on below architecture. Need to know advantages and disadvantages of below architecture.

We  need to create metadata driven architecture where Metadata is nothing but UI layout .i.e Form layout consisting of Form and Controls which needs to be stored in a database. And UI will be generated from this metadata dynamically and will be rendered on browser. 

Please advice is it good idea to dynamically create a form from Metadata? 




Architecture for management of downloadable files by temporary link from server

2016-12-26T11:20:38.807-08:00

Hi everyone,

I state immediately that I'm not an expert about ASP.NET but I just approached this world. I come right to the point. The main goal is distribution of a software package by download it from a personal area of a web server.

In outline the process is this:
1. A user registers himself on the website by entering the usual data such as e-mail address;
2. He get an email with a temporary link for e-mail confirmation;
3. After the e-mail confirmation, in his area is activated a link where the user can download the installer of the program;

Of course, all done in ASP.NET.

So I would start a discussion about this subject about how to achive my goal,. Does anyone know direct me?

Thank you all

Greetings




How to collect Manufacturing unit machine details data automatically?

2016-12-30T01:55:06.5-08:00

Dear All,

We have different type of requirement from our manufacturing Unit, in our manufacturing unit we have nearly 10 to 15 machines, and they would like to collect machine details like machine processing time, idle time, breakdowns, and throughput. On daily basis these information should be captured automatically and store it in database without manual interruption.

Is it possible via .Net program? if so please share your thoughts that how to achieve this using .Net.

Warm Regards,

Mayil.M




Automatic Email notification from ASP.NET with out window service or console app

2016-11-30T11:44:36.147-08:00

We have developed application in ASP.net, database is SQL server and deployed in local iis server on client environment. Currently we got new requirements to send notification email to user before 30 days of content expiration.

Client clearly said they will not install and maintain the window service or console application scheduled task on their server.

Is there any way to send the automatic notification from asp.net application? Please share your solution approach to achieve this.




Constructor vs Setter Dependency Injection

2016-12-26T15:08:16.763-08:00

Hi All,

I heard in some articles that difference between setter dependency and constructor dependency is - 

Setter dependency can be optional but constructor dependencies are those which class should be implementing. 

To understand more can some give some material which explains this concept in detail with an examples. I have not found any material which explains this with an example.

Thanks in advance !!




Webservices API

2016-12-16T18:46:41.84-08:00

Hello, Could someone please explain some real world examples that use webservices api
and in particular that use JSON for data interchange




High Availability Scheduler

2016-12-15T15:38:22.53-08:00

We have couple of tasks which need to be performed at particular datetime of every month. Ex: 5th midnight of every month, last day of the month.

We had created windows service to call a WCF endpoint at the scheduled time to achieve this.

But since we have moved on to support high availability, our .NET application is hosted on multiple non clustered windows servers sitting behind h/w load-balancers.

Now deploying this windows service on the three application servers results in running the job thrice.

Our deployment structure looks like the following,

Load Balancer -> Web Server 1, 2, 3 -> Load Balancer -> App Server 1, 2, 3 -> Clustered SQL Server

We also use Reactive Extension, clustered RabbitMQ and Redis for other use cases.

We looked into clustered task scheduler but our servers are not clustered.

Please suggest an approach to solve this problem



Shared Model or Duplicate Model?

2016-12-12T18:34:46.96-08:00

Imagine you have a Web App and a Web API that the app calls.  Further imagine that you have an Employee class that is your model:

public class Employee
{
    public string FirstName { get; set; }
    public string LastName  { get; set; }
    public int EmployeeId   { get; set; }
    .
    .
    .
}

I'm wondering what is the best practice wrt this model.  I can think of 3 scenarios:

  1. Include it in the Web API and reference it in the Web App.
  2. Include it in the Web App and reference it in the Web API.
  3. Have an identical copy of the Employee class in both projects.

Which approach do you use and why?

Robert




Angular2 in Core vs Conventional MVC

2016-12-02T15:06:42.74-08:00

I have moderate proficiency with ASP MVC and also feel pretty comfortable now with Core. I'm going to start a new project pretty soon that will be heavy on the visual aspects and light on backend data services. Bootstrap will be used heavily.

I'm trying to decide if I want to use Angular 2 with Core or just stick with regular MVC in Core. I tried an excellent template for Angular 2 in Core http://blog.stevensanderson.com/2016/10/04/angular2-template-for-visual-studio/ to jump start the learning process.

However, it seems to me that using Angular 2 in Core gives up a huge amount of IntelliSense benefit as lots of Angular code doesn't seem to have this support. I rely on IntelliSense very heavily as coding is only one part of my software development. It's what I love about Visual Studio.

So, my question is: even understanding some of the Angular benefits, and given that I have limited time to learn a whole new technology, is there some compelling reason to use Angular 2 in Core versus just staying with a conventional MVC development model?




Plugin architecture

2015-11-20T08:37:51.61-08:00

Hi,

I'm developing an enterprise web application that is based on ASP.NET 5 and MVC6 for .NET Framework 4.6. It consists of service and desktop applications as well as a web server application. It already has a few shared assemblies for common data structures and classes. And it already has a working plugin mechanism that allows me to load any plugin with a specific shared base class from a separate assembly into a host application.

The web application must be extensible through the same plugin system as well. So I'm looking for ideas how to build that. I have some experience with ASP.NET Web Forms and MVC from .NET 4.0 and I have read quite some articles about ASP.NET 5. So while I know how to make controllers, views, routes and configuration in a single application, I have no idea how this can be extended with a plugin system.

Plugins should be able to provide full views with the corresponding controllers, accessible through their own URL route. The route should be provided by the plugin itself so that the host application just needs to load the plugin and know nothing about its specifics. Multiple instances of a plugin can be loaded and they have their individual configuration so they could make unique routes on their own if necessary.

I think I need some form of Razor view pre-compilation to include it in a plugin assembly. I've seen such approaches for MVC 3 elsewhere but they don't seem to work anymore. Is that correct and how could I do that?

Then I think I need to tell the ASP.NET runtime about new routes, controllers and views after a plugin has been discovered and loaded. Route configuration is normally done in startup code only. Can it be altered later, too? And will the runtime find controller types in assemblies that have been dynamically loaded after startup?

Are there any articles covering such topics?




Processing Uploaded Files

2016-11-29T18:44:23.49-08:00

Hello,

In our Web Forms application, we are uploading PDF files to a temporary folder on the web server.  We would then like to process the PDF files (one-by-one) and store in the database. Is it recommended to 1) Create Windows console app and schedule 2) Create a windows service and set up task scheduler 3) Use 'HangFire' like background service 

We need to actively monitor the temporary folder for any new files. When a new file arrives we need to process the file. Every new file needs to processed in its own thread/async.

Please advice and/or recommend solutions.

Thanks.




where to put cache layer

2016-11-26T17:02:27.8-08:00

Hi all,

I read an article in : http://dotnetdaily.net/tutorials/n-tier-architecture-asp-net/

So I wonder ask where to put cache layer ? Anyone has experiences give me advice ?
Thank you so much !




Ntier architecture

2016-11-26T11:31:17.513-08:00

Hi all,

I'm buiding an web application . Anyone have best tutorial about ntier architecture ? How can transform data between layers ?
Mean that i intend to build framework to re-use later but dont know where to start !

Thank you so much !




how to open method in rest web servics

2016-11-21T09:26:50.693-08:00

hi

i tray to add new method in my rest web service but when i test it it give me error

it doesn't work  when i add parameter but when i don't add parameter it work !

this is my code 

 [HttpGet]
        [ActionName("rrrr")]

        public String GetCDEF()
        {
            return "ddddddd";
        }
 
        [HttpGet]
        [ActionName("rrrr")]
        public string GetRetriveData(int s)
        {
            s = s * 3;
            return s.ToString();
}

and the apiconfig

public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services
            // Configure Web API to use only bearer token authentication.
            config.SuppressDefaultHostAuthentication();
            config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));

            // Web API routes
            config.MapHttpAttributeRoutes();
            config.Routes.MapHttpRoute(
              name: "ActionApi",
              routeTemplate: "api/{controller}/{Action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }




Test driven development

2016-11-02T19:21:27.813-07:00

Hi All,

Am bit confused to use TDD in N-tire app design, if it simple app okey, when it getting bigger structure it bit complex to development

I have some set of question regarding TTD.

1. Why we prefer TTD first, before get into real code design, we have to follow some rules(GWT- Given, When, Then )?

2. Usually which layer we have to write TDD?, then followed by real code.

Note: In my design has below layers

  • UI : MVC
  • Business : C# library package
  • Data access: C# library package
  • Service layer : C# library package
  • Shared code : C# library package

3. Advantage, I hope some enhancement may be small, that time we no need to go and check all scenario manually, just RUN TTD we can get how many scenarios passed and how many failed.

Thanks,