legacy-code

AngularJS legacy integration and content that contains asynchronously changing id doesn't trigger watcher

☆樱花仙子☆ 提交于 2019-12-13 07:21:30
问题 I have a legacy page that has a <input type="hidden" id="myId" value="somenumber"> that is populated with Jquery (legacy code) asynchronously after the page loads for the first time. On this page I am trying to have an angularjs directive. The only problem is I am trying to watch on #myId value so I can use it for my directive but the value changes and triggers the watcher once and it is empty - it doesn't happen again when it actually gets a numercal value from jquery. What am I doing wrong?

CQRS with Legacy Systems

旧城冷巷雨未停 提交于 2019-12-12 07:57:19
问题 I'm looking to convert a relatively new web-based application with a clear domain model over to more of a CQRS style system. My new application is essentially an enhanced replacement of an older existing system. The existing systems in my organization share a set of common databases, which are updated by an untold number of applications (developed via the Chaos Method) that exist in silos throughout the company. (As it stands, I believe that no single person in the company can identify them

How do I use a legacy javascript library as a scoped dependency of an Angular service?

不羁的心 提交于 2019-12-11 23:13:25
问题 Specifically, I am working with an ~800 line SCORM API wrapper library that facilitates communication with an LMS. The author did not write it in Angular. A legacy, vanilla js file(index.js) has been wrapped over top of it I'm including a snippet of both to give an idea of the structure being used here. SCORM = { //Define the SCORM object version: null, //Store SCORM version. handleCompletionStatus: true, //Whether or not the wrapper should automatically handle the initial completion status

Creating object “Catalog” for DI agnostic library

安稳与你 提交于 2019-12-11 07:09:04
问题 I am developing an internal library that is to be used by other developers in the company that I'm working for. I am applying SOLID patterns and following the best practices as described in Dependency Inject (DI) “friendly” library. My end users would be developers of different applications. Some of them are complex legacy applications with no DI, and others are newer apps that have DI and TDD. Now, I am trying to figure out how to call this DI friendly library from a legacy ASP.NET Webforms

How can I load non-AMD dependencies in the defined order with dojo?

情到浓时终转凉″ 提交于 2019-12-10 10:39:18
问题 I try to make a non-AMD library loadable with dojo, I've chosen a separate folder as a new (pseudo) AMD-package and placed the files of that library in that folder, together with the main.js file, which will get loaded by convention by the dojo loader when the package is requested. In this main.js file I simply put the names of my library files in the dependency list of the define() call. define([ "jquery", "./lib/jquery-ui/jquery-ui.min", "./the.actual.library.that.uses.the.others", ],

How to go about mocking a class with final methods?

左心房为你撑大大i 提交于 2019-12-09 12:01:25
问题 Say I have class A with class A { final String foo() { // .. computing result, contacting database, whatever .. return "some computed value"; } // ... and a bazillion other methods, some of them final. } Now I have class B with class B { String methodIWantToTest(A a) { String output = a.foo(); // ... whatever this method does, e.g.: output += "_suffix"; return output; } } How would I go about unit testing this method? The reason foo() is final is because we don't want our classes which extend

Generics in legacy code

我是研究僧i 提交于 2019-12-08 16:12:29
问题 We've got a fairly large amount of code that just made the jump to Java 5. We've been using generics in those components targeted at being released in the Java 5 version, but the remaining code is, of course, full of raw types. I've set the compiler to generate an error for raw types and started manually clearing them, but at the present rate it'll take a very long time to go through with it (there are about 2500 errors). And that's with Eclipse's helpful Infer Generic Type quick fix, which

How can I handle exit() calls in 3rd party library code?

核能气质少年 提交于 2019-12-08 15:27:07
问题 I'm working on a C++ application which uses a library written in C by another team. The writers of the library like to call exit() when errors happen, which ends the program immediately without calling the destructors of objects on the stack in the C++ application. The application sets up some system resources which don't automatically get reclaimed by the operating system after the process ends (shared memory regions, interprocess mutexes, etc), so this is a problem. I have complete source

Best Option for Retrospective application of TDD into C# codebase

白昼怎懂夜的黑 提交于 2019-12-07 06:05:41
问题 I have an existing framework consisting of 5 C# libraries, the framework is well used since 2006 and is the main code base to the majority of my projects. My company wishes to roll out TDD for reasons of software quality; having worked through many tutorials and reading the theory I understand the benefits of TDD. Time is not unlimited I need to make plans for a pragmatic approach to this. From what I know already, the options as I see them are: A) One test project could be used in order to

Can I use a *.tlb file without using Regasm to register it on the computer

狂风中的少年 提交于 2019-12-06 05:50:21
We are supporting an aging VB6 system that we have written new code for in .Net, put the code into assemblies and then exported *.tlb files for use with the VB6 codebase. My question is, on every computer I wish to run the code on, do I have to use Regasm to register the type libraries? I ask because it gets difficult to keep track of type library installations as computers break, new computers get added etc. Also, if we update the .Net code, we need to go around every computer and re-register the type library. To sum up, is it possible to run .Net code from VB6 without having to register the