architecture

Is the dependency injection a cross-cutting concern?

风流意气都作罢 提交于 2020-01-15 11:48:11
问题 I am designing an app and I am using a n-layer architecture, I have: - a presentation layer - a domain bussines layer - a data acccess layer - a cross-cutting layer Then I am trying to isolate my project from an specific DI framework, that is create my own IContainer interface and ensure that my components depends only to this interface. Then I have 2 questions. 1 - Is this last a good practice ? 2 - (And the more important) Is dependency injection a cross-cutting concern ? That is can I

How can I create a plugin mechanism that calls functions only when the plugin is available?

不羁的心 提交于 2020-01-15 06:54:12
问题 Sorry if I am not clear enough, I've had a hard time writing this question. I downloaded an open source software. I would like to expand the functionalities so I would like to create modules that encapsulates the functionality these modules would be .dll files. I would like to have one completely independent from another: if I set a key to true in the config file and if the DLL is present on the folder, the plugin should be loaded. The problem is: how can I make the call for the plugin

How to send HTML form RESTfully?

南笙酒味 提交于 2020-01-14 14:46:09
问题 I have a URI for a collection of resources called 'facts', and URIs for each 'fact' resource in that collection. The form for creating a new 'fact' should be requested with a GET, I believe, but I'm having trouble deciding what URI it should be made to. A GET to the collection URI should return a list of the 'fact' resource URIs. Each 'fact' URI should return its contents as a response to GET. The actual 'fact' creation would be a POST (or PUT, depending on the situation), of course. I see a

How does python represent such large integers?

血红的双手。 提交于 2020-01-14 12:46:29
问题 In C, C++, and Java, an integer has a certain range. One thing I realized in Python is that I can calculate really large integers such as pow(2, 100) . The same equivalent code, in C, pow(2, 100) would clearly cause an overflow since in 32-bit architecture, the unsigned integer type ranges from 0 to 2^32-1. How is it possible for Python to calculate these large numbers? 回答1: Basically, big numbers in Python are stored in arrays of 'digits'. That's quoted, right, because each 'digit' could

A database schema for Tags (eg. each Post has some optional tags)

ぐ巨炮叔叔 提交于 2020-01-14 08:06:06
问题 I have a site like SO, Wordpress, etc, where you make a post and u can have (optional) tags against it. What is a common database schema to handle this? I'm assuming it's a many<->many structure, with three tables. Anyone have any ideas? 回答1: A three table many to many structure should be fine. Eg. Posts, PostsToTags(post_id,tag_id), Tags The key is indexing. Make sure you PostsToTags table is indexed both ways ( post_id,tag_id and tag_id,post_id ) also if read performance is ultra critical

Is returning DataTable or DataSet from DAL is wrong approach

我只是一个虾纸丫 提交于 2020-01-14 05:43:47
问题 I am creating my assignment project from scratch, I started off by creating a DAL that handles connection to SQL and can execute stored procedure. The project later will be a CMS or Blog My DAC or DAL is reading connection string from web.config and accepting arrays of SQL Parameters along with Stored Procedure Name and is returning output of the executed stored procedure in DataTable . I am calling my DAC as follows( using class functions and sometimes using code behind) Dim dt As DataTable

Architecting webserver (NginX/Lighttpd/Apache) with couchbase

浪子不回头ぞ 提交于 2020-01-14 05:30:17
问题 I have this architectural question that I'm hoping some of you can share with me. In your past experience, which scenario works better for high load application/dbase server. I'm using Couchbase as a dbase and one of the Web server (NginX/Lighttpd/Apache). This is going to be hard to explain in text so I hope I make some sense. Which scenario is preferred? Scenario 1. Client connect to webserver master cluster which select the proper available webserver (machine 2) and the (webserver machine

Is unit of work a good pattern for transactions that will auto generate new objects (auto_increment id)?

拥有回忆 提交于 2020-01-14 00:33:50
问题 From the unit of work pattern i uderstand a method of doing typic transactions based on some domain repostiries (using a repository per domain object) . Example : after defining some repository objects in the UoW object , commit those repositories based on theyr state . Also the repositories should not contain any transaction logic . What happens when an insert() leads to a creation of a new object (auto generated id) that later on is needed by another object in the same transaction ? Unit of

Multiple independent mariadb usages: multiple containers or one? Isolation vs efficiency?

喜欢而已 提交于 2020-01-13 13:12:42
问题 I have an architectural question. Suppose we have a system that has multiple sub-systems: A , B , and so on. Each of these sub-system needs to persist their data and they all use MariaDB . Sub-system A may need a database (as in create database ... ) called a_db ; and Sub-system B may need a database called b_db . Furthermore, there are no data sharing across A and B In a monolithic world before microservice and docker, it is common to set up one central MariaDB instance and ask each sub

Two microservices for read and write to one database table

丶灬走出姿态 提交于 2020-01-13 10:49:10
问题 I'm a little bit confused about the microservice best practice approach. Following scenario: Massive incoming messages from mqtt devices. A rest api where customers could read the messages (mostly only a part of them). My idea was, to create one microservice for storing the messages in a database table. And a second microservice with a rest api to read this messages. I want to do this, because of scaling issues. (The incoming storing part needs much more power, than the reading rest api) I