legacy-code

I'm maintaining a Java class that's 40K lines long.. problem?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 11:04:21
问题 This may be a subjective question leading to deletion but I would really like some feedback. Recently, I moved to another very large enterprise project where I work as a developer. I was aghast to find most classes in the project are anywhere from 8K to 50K lines long with methods that are 1K to 8K lines long. It's mostly business logic dealing with DB tables and data management, full of conditional statements to handle the use cases. Are classes this large common in large enterprise systems?

How to use the Symfony 2 Container in a legacy app

久未见 提交于 2019-12-03 07:02:30
Would like to integrate a legacy application with a Symfony 2 application - replacing more and more parts of the old application with Symfony components. The approach I would take is using the Symfony 2 container in the legacy application getting the services that are already configured for the Symfony 2 application. The first services I would like to use are the session and the security context. Questions: Is this feasible? How do I get the configured service container? More info in the legacy application: The typical PHP mess: Single PHP files, as "controllers" (checking $_GET and $_POST for

Legacy Code Nightmare [closed]

岁酱吖の 提交于 2019-12-03 04:14:53
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I've inherited a project where the class diagrams closely resemble a spider web on a plate of spaghetti. I've written about 300 unit tests in the past two months to give myself a safety net covering the main executable. I have my library of agile development books within reach at any given moment: Working

I'm maintaining a Java class that's 40K lines long.. problem?

北城以北 提交于 2019-12-03 02:38:45
This may be a subjective question leading to deletion but I would really like some feedback. Recently, I moved to another very large enterprise project where I work as a developer. I was aghast to find most classes in the project are anywhere from 8K to 50K lines long with methods that are 1K to 8K lines long. It's mostly business logic dealing with DB tables and data management, full of conditional statements to handle the use cases. Are classes this large common in large enterprise systems? I realize without looking at the code it's hard to make a determination, but have you ever worked on a

Coding Katas for practicing the refactoring of legacy code

冷暖自知 提交于 2019-12-03 01:30:20
问题 I've gotten quite interested in coding katas in recent months. I believe they are a great way to hone my programming skills and improve the quality of the code I write on the job. There are numerous places where Katas can be found. like.. http://codekata.pragprog.com/ http://schuchert.wikispaces.com/Katas http://www.codingdojo.org/ I've found these to be excellent repositories of Katas... my attempts at some of them have been been immensely rewarding. However, I feel that all the Kata's I've

Advice on working with legacy code

孤街浪徒 提交于 2019-12-02 15:08:59
I need some advice on how to work with legacy code. A while ago, I was given the task to add a few reports to a reporting app. written in Struts 1, back in 2005. No big deal, but the code is quite messy. No usage of Action forms, and basically the code is one huge action, and a lot of if-else statements inside. Also, no one here has functional knowledge on this. We just happened to have it in our contract. I'm quite unhappy about this, and not sure how to proceed. This application is invisible: Few people (but all very important) use it, so they don't care whether my eyes bleed while reading

Coding Katas for practicing the refactoring of legacy code

北战南征 提交于 2019-12-02 13:47:59
I've gotten quite interested in coding katas in recent months. I believe they are a great way to hone my programming skills and improve the quality of the code I write on the job. There are numerous places where Katas can be found. like.. http://codekata.pragprog.com/ http://schuchert.wikispaces.com/Katas http://www.codingdojo.org/ I've found these to be excellent repositories of Katas... my attempts at some of them have been been immensely rewarding. However, I feel that all the Kata's I've seen so far have one short coming. None of them seem to allow me to practice refactoring bad code. It's

Utility to Convert Legacy VB6 Function Calls to .NET [closed]

浪子不回头ぞ 提交于 2019-12-02 01:10:33
I am looking for a utility/tool to convert calls to legacy VB6 functions to the .NET equivalent. For example, it would convert this... FormatCurrency(Cart.TotalAmount) Len(Str) UCase(Str) UBound(PaymentsArray) To this... Cart.TotalAmount.ToString("c") Str.Length Str.ToUpper() PaymentsArray.Length - 1 Does anybody know of one, or am I going to have to roll my own? Do you need a conversion for those functions? The vb6 functions work just fine in vb.net. MarkJ If your code is already converted to working VB.Net, why not just leave the calls as they are? The routines are in Microsoft.VisualBasic

How to “auto close” Alert boxes

╄→гoц情女王★ 提交于 2019-11-30 09:05:26
问题 We have a control that was made by a company that no longer exists. For some odd reason on page load it has now started rendering something like this to the page: <script type="text/javascript"> alert('Your license has expired!') </script> Since the company no longer exists we can't get support and the control is also very complex and is running in some legacy code that can't be quickly replaced so simply rewriting the page is also not an option (yet). What I need to do for the time being is

How to unit test a method with a `using` statement?

不问归期 提交于 2019-11-30 08:18:54
How can I write a unit test for a method that has a using statement? For example let assume that I have a method Foo . public bool Foo() { using (IMyDisposableClass client = new MyDisposableClass()) { return client.SomeOtherMethod(); } } How can I test something like the code above? Sometimes I choose not to use using statement and Dispose() an object manually. I hope that someone will show me a trick I can use. If you construct the IMyDisposableClass using a factory (injected into the parent class) rather than using the new keyword, you can mock the IMyDisposable and do a verify on the