application-design

Working with Node.JS

谁说我不能喝 提交于 2020-01-01 02:53:15
问题 Last night I dump windows 7 and formatted my hard driver to port to a Linux based operating system, Purely for the reasons that I wanted to start working with Node.JS So I have installed Node.JS and have done a few test stuff, the http server and sockets etc. What I would like to do is build a HTTP Server that is tightly intergrated with an MVC Framework, but before I get started on all that I need to learn how to build efficiently in Node. For example within PHP as my framework I would

What approach can i take to developing a Desktop application using Web Technologies

≯℡__Kan透↙ 提交于 2019-12-21 21:43:55
问题 i am wondering if there is any way i can create an app that starts as a desktop application, for personal use for now. and since desktop applications can work with my HDD files which i may want to manage but don't feel secure throwing them onto a web server. but what i think i may want to do in the future is port the app to the web since that is where i think is the future of applications to come. web apps are available everywhere eg. web apps can be used on smart phones etc. facilitate team

How do you run your unit tests? Compiler flags? Static libraries?

柔情痞子 提交于 2019-12-20 09:56:23
问题 I'm just getting started with TDD and am curious as to what approaches others take to run their tests. For reference, I am using the google testing framework, but I believe the question is applicable to most other testing frameworks and to languages other than C/C++. My general approach so far has been to do one of three things: Write the majority of the application in a static library, then create two executables. One executable is the application itself, while the other is the test runner

What is the best “forgot my password” method? [duplicate]

a 夏天 提交于 2019-12-17 10:11:03
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Forgot Password: what is the best method of implementing a forgot password function? I'm programming a community website. I want to build a "forgot my password" feature. Looking around at different sites, I've found they employ one of three options : send the user an email with a link to a unique, hidden URL that allows him to change his password (Gmail and Amazon) send the user an email with a new, randomly

How can I prevent my desktop application from breaking horribly when the user messes with its files at run-time?

谁说我不能喝 提交于 2019-12-13 18:15:08
问题 Such as deleting the output file during run, directing two instances of the sw to the same IO etc ? 回答1: There isn't much you can do to prevent the user from doing that, but what you can do is to apply defensive programming. In your two examples you'd have to, every time you access a resource, detect failure conditions and react appropriately either throwing exceptions and dying or continuing without access to that resource. Never assume a resource allocation will succeed, always check what

Generic interface problem

与世无争的帅哥 提交于 2019-12-08 07:33:34
问题 I'd like to have one interface for all my grid related tasks.The tasks implement this interface: public interface IDataForGrid<T> { IGridResponse<T> GetList(IGridRequest request); } The T type is always a DTO class. I cant't create a common interface for this DTOs because they have nothing common.Just a dumb DTO with particular properties. I'd like to use it like this : public class Service1 { public IGridResponse CreateResponse(IGridRequest request) { ... IDataForGrid<T> aa; if(request == 1)

How to structure interfaces in application directory hierarchy?

 ̄綄美尐妖づ 提交于 2019-12-08 01:48:15
问题 Put them all in one separate folder structure or along with classes which implements them ? 回答1: You should never put interfaces together with the classes that implement them (unless those classes fulfull the requirements below). Doing that will introduce a tight coupling between the interface and the implementer, and you will not be able to create other implementations of the interface without simulataneously referencing the implementer. You basically have two options: Put the interfaces

Generic interface problem

别说谁变了你拦得住时间么 提交于 2019-12-07 06:04:27
I'd like to have one interface for all my grid related tasks.The tasks implement this interface: public interface IDataForGrid<T> { IGridResponse<T> GetList(IGridRequest request); } The T type is always a DTO class. I cant't create a common interface for this DTOs because they have nothing common.Just a dumb DTO with particular properties. I'd like to use it like this : public class Service1 { public IGridResponse CreateResponse(IGridRequest request) { ... IDataForGrid<T> aa; if(request == 1) aa = new CustomerGridData; if(request == 2) aa = new OrderGridData; var coll = aa.GetList(); } }

How to structure interfaces in application directory hierarchy?

房东的猫 提交于 2019-12-06 05:40:22
Put them all in one separate folder structure or along with classes which implements them ? You should never put interfaces together with the classes that implement them (unless those classes fulfull the requirements below). Doing that will introduce a tight coupling between the interface and the implementer, and you will not be able to create other implementations of the interface without simulataneously referencing the implementer. You basically have two options: Put the interfaces together with the classes consuming them. This still creates a tight coupling, but this coupling is less

Are sequential numbers necessary?

北慕城南 提交于 2019-12-05 11:26:45
I am working on a winform (.NET) application which includes Orders, Invoices, Service Orders, Ticketing etc. It it necessary for these enities to be sequential when numbering their IDs? IMO no. Take an order for instance, it can only be valid once it passes thorugh the business layer, during that proocess another order could've been created, approved and saved with the number 2 while the order which was created earlier with id 1 failed validation. This seems to open a can of worms as to which layer assigns the order number, no? Currently I am using non-sequential numbers prefixed with an