architecture

Implementing OOP PHP with AJAX, MVC?

馋奶兔 提交于 2019-12-23 12:04:47
问题 I'm new to the OOP paradigm (and AJAX/jQuery), but would like to create a basic site employing MVC architecture, in PHP, with AJAX functionality. I drew up a brief diagram of how I currently 'understand' the architecture. Presumably when AJAX is used, that acts as the controller to interact with the model directly to retrieve whatever functionality is needed? The filenames I added are just to give you an idea of what I 'think' should be included. e.g. index.php would be a html/css template

WPF / EntityFramework Context Lifetime

天大地大妈咪最大 提交于 2019-12-23 10:17:41
问题 Issue We are currently having a problem of architecture on a WPF application. It concerns EntityFramework context management, it’s instantiated once and used during the entire life of the application. So we end up with a cache issue, entities are not updated when they were loaded once. Our entities are obsolete when using the application. Technical specification Wpf project .Net Framework 4 client Profile MEF (Include in Framework 4.0 System.ComponentModel.Composition) Design pattern MVVM

Testing with GTest and GMock: shared vs. static libraries

南楼画角 提交于 2019-12-23 10:00:06
问题 I think this question may violate some of the Q&A standards for the site, as the answer(s) I may receive could be regarded as opinion-driven. Nevertheless, here it goes... Suppose we're working on a C++ project, using CMake to drive the build/testing/packaging process, and GTest and GMock for testing. Further suppose the structure of our project looks like this: cool_project | |-- source | | | |-- module_foo | | | | | |-- (bunch of source files) | | | |-- module_bar | | | |-- (yet more source

what are the major steps required to create multiple instances of a meteor.js application running on a single server?

喜你入骨 提交于 2019-12-23 09:21:56
问题 I have designed a meteor.js application and it works great on localhost and even when deployed to the internet. Now I want create a sign-up site that will spin up new instances of the application for each client who signs up on the back-end. Assuming a meteor.js application and python or javascript for the sign-up site, what high level steps need to be taken to implement this? I am looking for a more correct and complete answer that takes the form of my poorly imagined version of this: Use

Elegantly Determining System Architecture Within Perl

╄→尐↘猪︶ㄣ 提交于 2019-12-23 09:16:02
问题 I'm looking for a simple way to determine whether a system is 32- or 64-bit from within Perl 5. I have read the perlvar manual page backwards and forwards, and have not discovered a variable that contains the system's CPU architecture (the CPU architecture Perl was compiled for will come close enough). This is the closest I have come: chomp (my $arch = `uname -m`); I was wondering if there was a more elegant way of determining this; I hate relying on backtick expressions, as they are both a

Does ASP.NET MVC allow private ViewModel constructor?

前提是你 提交于 2019-12-23 08:59:37
问题 The question is, as in title, whether the MVC model binder allow private constructors for the view model objects. Apparently it doesn't, saying MissingMethodException: No parameterless constructor defined for this object. even if there is a private parameterless constructor. In case if there is no private constructor allowed, is there an arhitectural workaround? Such constructor might be useful to ensure that only the model binder could create ViewModel objects whose fields might not be

Is it possible to create a Component abstraction on Angular 2?

二次信任 提交于 2019-12-23 07:00:09
问题 I want to create a AbstractComponent with initial behavior while being able to override it on child when needed, is it possible? Is it a good practice? Should look more or less like that: export abstract class AbstractComponent implements OnInit { constructor(authService: AuthService, router: Router) {} ngOnInit() { if (authService.userNotLoggedInAnymore()) { router.navigate(['Login']); } } ... } 回答1: Yes, just extend that class with the real @Component and call super() in the methods you

Is nodejs representing Reactor or Proactor design pattern?

[亡魂溺海] 提交于 2019-12-23 05:35:11
问题 Many articles online demonstrates nodejs as an example of reactor pattern. Isn't it rather proactor? As far as I understand, the difference between the two is: reactor handles events in a single thread (synchronously), proactor handles events is multiple threads (asynchronously) with completion callbacks. For example in this article: Reactor Pattern is an idea of non-blocking I/O operations in Node.js. This pattern provides a handler(in case of Node.js, a callback function) that is associated

DDD: DTO usage with different logic

≡放荡痞女 提交于 2019-12-23 05:23:48
问题 I am currently working on a DDD project and recently faced an issue regarding the use of DTOs. I have the following DTO in my domain (code is in php but could be in any language): class TranslationDto { private $locale; private $text; public function getLocale(...); public function getText(...); } The goal is that the UI will give the domain a DTO with a locale and its corresponding text. So for example, if the locale "FR" is not translated, the DTO will look like the following: // UI =>

Synchronize writes to DB from dynamically scaled microservices

末鹿安然 提交于 2019-12-23 05:14:40
问题 Background with example: We are building a stream processing application that receives a stream of data, runs algorithms on the data and stores the results in a database. As an example for this question let's use a stream of purchases. Each purchase has the geo-location of the purchase (store location or IP based location). The stream of purchases is coming from a Kafka topic. We now want to process that stream of data and output some statistics. For example, we want to see the average