Tool determining class and method importance [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
When facing new code I often spend time to figure out which classes and methods constitute core functionality in contrary to just ambient stuff. If code adheres to well known architectural design, have visible structure, descriptive names, documentation, unit tests etc. then the task is easier. However that is not always the case. Sometimes the code is just a pasta and God knows what is going on there.
I believe that there are some algorithms that could be use in order to roughly categorize code parts so that the developer can see important things in a glance without manual processing.
For example:
In case of views and view models the tool could highlight bindings in the later so that the developer could see entry points.
Using of methods and classes occurs at some level of invocation chain. Some methods have the opportunity to be invoked only deeply in logic (low priority). Others are invoked directly from user action handlers (high priority).
Is there a tool that will be able to filter or highlight classes and methods in Visual Studio depenging on the code importance?
It could look like the follows:
Under importance I understand here that for example the Main method has high importance because it's a root of everything else. You can go from Main method to any other method in the code. MethodL2 has low importance because it is just a leaf. Calculation of leaves importance should be also derived from they parents importance. I mean that an importance in this meaning is not only about the level of depth or occurencies.

Related

Programs with available code for practice [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm currently learning C# and was wondering if there are any sites that provide like an assigment to build working basic program, but has the full code available, so you could use it if you're completely lost.
I did maybe 20 ProjectEuler questions, but they're mostly math questions and I really need some practice in building actual programs, because now after reading few C# books i still have very limited understanding how to make the whole interconnected systems.
Thanks for any suggestions
This type of question is a good case for 2 things that are useful. One: an imagination. Think very carefully of normal tasks you do every day that could be accomplished or simplified by writing a program. If none exist (which is likely) then this is where the second option comes in to play. It requires a little explanation though. One practice that is starting to become more popular (but also has a lot of discussion about how to do it properly) is Test Driven Development (TDD). Now I'm not going to tell you how to do TDD, nor am I going to say go down that path. One of the excercises though to get used to TDD is what is helpful though. They call it a Kata. In America we would call it a drill, or excercise. Something we repeate frequently to drive home the point. (Anyone remember multiplication table drills?)
Anywho. What is nice about this is that the test framework (NUnit) is a very easy to understand system of pass or fail. You'll know if you got the code right. Since the majority of all programs is the logic and implementation, and in comparison little is on the view of the program it isn't a bad place to start. To help with this if you look into NuGet you can download two very small packages. Nunit, and Nunit test runner. With those two packages you can run a Nunit test inside Visual Studio easily and with hardly any setup. One of my favorite Kata's to do is the Bowling Score Keeper. In my opinion writing tests to learn a language is a very effective tool in learning it. You'll learn by doing, and you'll have the same language telling you if you did it right or not.

ORM framework to legacy database without SQL support [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
We're going to start writing C# programs against a old legacy database from the early 1980s. There is no support for SQL or relationships, and communication with it is through Telnet commands.
I'm thinking of using some sort of ORM framework, or write my own. My question is if there is any good framework that is possible to easily adapt to these special conditions?
I want to be able to map the classes in my program against tables in the database and work with the database in a modern way, without having to think about the complex telnet commands and the translation of the returned information into something meaningful.
I find it hard to believe that such datasources have any usable adapters today. Think of what kind of operations you will need and construct an ORM with any commands you may require. Depending on structure and data this may vary in a lot of different ways. Some questions you may take along in this project are
Can we standardize CRUD operations or do we have to build a DTO api
Shall we be able to handle any binary data
What pattern shall we use in our C# code and will C# suffice
When it comes to DTO-Api's I like to implement CQRS (Command Query Responsibility Segregation, read this http://msdn.microsoft.com/en-us/library/jj591573.aspx). If you are constructing an ordinary CRUD-Api you will most likely have to separate your code differently and resolve each command type dynamically (if possible).
Feel free to e-mail me, you should be able to reach me in the corp-ad.

Create a superclass from multiple classes that have common members [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've had this a number of times now. In longer running software projects two or three classes are totally different at the outset. However, as time goes by requirements change, users get a bit smarter, on rare occasions I even get a bit smarter and two seemingly different processes turn out to be very similar. As a consequence, code needs to be modified and these two or three classes end up looking too similar for comfort. They're just screaming to be inherited from a common superclass.
Now I'm an innate lazy guy (reason why I'm making software in the first place) and I'd love to have a tool that does the merging into a superclass for me. With Resharper I can create a superclass from one type.
Does anyone know of a tool that can do this trick with multiple classes, or otherwise some kind of comparison tool that presents commonalities between a number of classes?
There is no tool I know of that can take two or more classes and simply define commonalities.
The closest I have seen in refactoring tools would only operate on a single class and still require input from a programmer.
This is a complex thing to do automatically, so in my opinion a programmer is the best tool...

Optimal language to develop with Unity? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I would like to ask you all about the Unity framework and programming. Unity supports three different languages; Boo, C# and Unityscript. Say you were new to programming and developing on OS X.
What is the best language to learn and use alongside Unity to create games?
First of all, it's a matter of taste. All 3 languages are fully capable. It's also worth mentioning that performance-wise there is no significant difference.
So, which one? You'll have to choose for yourself.
Perhaps this would help:
C#:
pros:
well known, easy to find people who know it
strict (find mistakes during compile time)
usable code bits may be found online, even outside Unity's context
cons:
why so serious?
UnityScript (not really JavaScript):
pros:
easy to learn quickly
cons:
not strict (find mistakes late - only during run-time)
Boo:
pros:
beautiful syntax (pythonesquely clean)
strict (find mistakes during compile time)
cons:
not many people use it (so if you're hiring...)
For me, a web developer, Javascript was easiest to use. I use C# when I need to, but Javascript is fastest for me and I don't notice any performance hits.
You can check out this thread on the Unity forums for choosing a language to work with:
http://forum.unity3d.com/threads/18507-Boo-C-and-JavaScript-in-Unity-Experiences-and-Opinions

Aspect Oriented Programming in C# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Are there any good resources to wrap my head around Aspect Oriented Programming?
PS: I need to understand AO programming, not the libraries or frameworks available for .NET or C# :)
Just to get your head around it: It is the ability to hook events such as: creation of objects, setting of properties, etc, and attach general functions to them, that will be populated with relevant context.
Because C# doesn't have an inbuilt facility for this, you need a framework, like PostSharp, to do 'bytecode weaving' (i.e. just writing code to actually make the calls, directly to your classes) to simulate it.
check this out, it is describing how to implement AOP ( log, timing, tracing, exception handling...) using postsharp
http://www.codeproject.com/Articles/337564/Aspect-Oriented-Programming-Using-Csharp-and-PostS
Aspect Oriented Programming means having a meta level where yo can define logging or security/access control features to interweave with your code instead of implementing these feature very time in your code. So instead of beeing one-dimensional, you have to program two-dimensional.
I know this may sound very esotheric but it is easy once you understood it.
AOP often works with proxy classes which intercept calls and do things in the background.
A good link below, shows you how to code up an AOP framework of your own. Unfortunately, all of your consuming classes have to inherit from the MarshalByRefObject (through ContextBoundObject).
http://www.developerfusion.com/article/5307/aspect-oriented-programming-using-net/3/

Categories

Resources