Resources to successfully making applications scriptable [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
In the process of designing an application we've come to the conclusion that the user needs to be available to add custom behaviour to the program and we want to allow this through scripting, however, none of us got any experience embedding a scripting engine in an application and even less designing the application to successfully allow the scripting to place.
We suppose that the key to making the application scriptable is to create a large set of events that the scripts can respond to, as well as exposing functions for the script to use. Instead of rushing into scripting recklessly we would prefer reading up on some resources on the topic.
We're looking for resources (preferably books) which covers the process of designing an application for scripting. Any advice would be awesome as well. More or less any advice on the topic would be nice.
If details of the project in question is needed just say so an I'll add a paragraph explaining more in-depth detail.

How techy do you want to make your scripting?
If your users are happy to use .Net then this artice gives an introduction to making an extensible application.
http://www.developerfusion.com/article/4529/using-net-to-make-your-application-scriptable/
When I was investigating a similar thing a while back I also found the technical notes for the sharpdevelop application to be very helpful.
http://www.icsharpcode.net/TechNotes/ProgramArchitecture.pdf
http://damieng.com/blog/2007/11/08/dissecting-a-c-application-inside-sharpdevelop

Embedding scripting capabilities into an application will depend very much on the language and technology that make up the application. In your case, developing with C# there are some interesting options because of the work on the Dynamic Language Runtime. You should probably take a look at the IronRuby and IronPython projects since they will provide the best overall integration with .NET applications since they are themselves implementations of the Ruby and Python scripting languages on the .NET platform. As my experience centers on Ruby predominantly I would look at the information on hosting IronRuby in a .NET application.
As far as a general book goes I would probably start here: Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages. For specifics on IronPython there is this title from Manning: IronPython in Action. And for IronRuby there is this book still in Beta: IronRuby in Action.
This may also be a solid resource coming out of Microsoft's Professional Developer's Conference: Using Dynamic Languages to Build Scriptable Apps.

Can you wait for C# 4.0 and the DLR (or deploy the beta)?
See Application Extensibility and Embedded Scripting.

How hard this is really depends on your requirements. It can be quite easy.
In my app, I built a small set of classes that exposed the basic data model that I wanted to be made available to scripts. I built a scripting manager that creates an instance of the IronPython engine, adds an instance of the data model's root object as a global, and loads and executes the script.
Now, in my case, I'm actually the one doing all the scripting. So I don't need any kind of fancy development environment or testbed application, and I have essentially zero security considerations. The problem would be a lot harder if I needed to worry about any of those things.

Related

Touchscreen App, Do I need to learn a new language? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'm making a multitouch-screen app that for its function will just have to get positions of objects on the screen, have them ordered, be able to select them and drag them (sounds basic). I will also have to have a kind of history of actions so I could press the typical "Ctrl+z" and get X number of actions undone
The only language I know is C++ and I have made two simple GUI programs for Windows 7 in the past. For the porpoise of my app which is meant to be used by professionals, the screen should be 14inchs or bigger, considering there are 2 O.S. that support touch-screen events: W8 and Android, and how the app needs to be (explained in the first paragraph):
Should I have to learn another language to get this done?
If yes, what should it be: C# or Java? By what reasons?
If no, could you recommend any C++ libraries to: manage touch-events, make the GUI (both libraries should be free for commercial use).
Have you considered using libgdx to write multiplatform stuff: http://libgdx.badlogicgames.com/features.html
there is a C++ plugin for it here:
http://aevumlab.com/libgdx-cpp/
The beauty of libraries like this (and there are quite a lot when you google them) is that if you haven't got the time to learn a new language you can work around it this way. That being said if you see yourself working closely with Android in the future it wouldn't hurtto dip your toe in Java.
First of all, what do you mean there are two operating systems that support touch-screen events? What about iPhone and Blackberry? Or Google Chrome OS?
In any case, I think you've got your question backwards, or I don't understand it. You do not choose a programming language and then decide your target platform. That hardly makes sense. You will usually have requirements by customers dictating the target platform, and only then you start to think about programming languages.
If there are multiple target platforms, then you may choose to reimplement the same application in different programming languages for each system. Or it may turn out better to use shared native C++ or C code which can be reused, at least partially, on several platforms. These are classical software-engineering tradeoffs, and it's impossible to tell you in general what's easier or more efficient.
You've tagged your question as "Android". For an Android app, you will usually want to implement as much as possible in Java and resort to native C++ or C code only if necessary. You do not use C# on Android. Mind that the often-heard assumption that native code is automatically faster is typically wrong and is made by people who do not measure but guess. Native code may be faster, but it may also be slower because of the extra indirection. However, as I said, reusability of native code on other platforms may be an important advantage and beat related disadvantages, such as reduced robustness or harder development.
C# does have some nice support for touch screen, and it is a great next step from C++. Learning an extremely object oriented language such as C# or Java is almost a must these days. Though a touch screen application isn't exactly 'Hello World', making a small, touch-based app is a good way to get into the WPF side of C#.
To get you started, see this MSDN article: http://msdn.microsoft.com/en-us/library/ee649090(v=vs.110).aspx

What is Microsoft's GWT solution for .NET? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I like GWT but I prefer to use ASP.NET MVC for my projects, however, these two are not integrated and require me to write my code in two different platforms and two languages. Does Microsoft have any solutions comparable to GWT for compiling C# into JavaScript? I know there is Script# which is not supported by MS and the Volta project which was killed after its preview, but I was wondering if there is any good solutions available now or at least some good open source project that can integrate ASP.NET with GWT. Thanks.
Well, I can tell you what my preferred stack looks like these days. To me it is a nice balance of established tech with flexibility, though keep in mind I use this mostly to build single-page ajax "apps", not for the traditional collection of pages.
Sharp UI (full disclosure: this is one of my open source projects)
Script#
jQuery
I use a tool I wrote internally for generating "packet" classes shared by WCF and Script#.
WCF (in JSON)
ASP.NET (either Webforms or MVC)
I get compile-time type checking from Script#, UI control encapsulation from Sharp UI, fairly easy to maintain JSON service endpoints through WCF and my code generation tool, and ASP.NET for misc or traditional web pages. I'm firing on all 8 cylinders with this setup.
Bridge.NET is in this space. It describes itself as:
Open Source C# to JavaScript Compiler and Frameworks.
Run Your App On Any Device Using JavaScript.
The Microsoft driven solution is TypeScript which is a separate language made with input from the lead architect of C#, Anders Hejlsberg. It is also open source.
Good suggestion, but as AFAIK there is absolutely nothing like GWT in the .Net world.
I'm a Java and .Net programmer. I've battled infrequently with javascript for about 3 years, and never become comfortable with it. Since adopting GWT I'm producing Javascript=based web pages but coding in Java - I absolutely adore it ;-)
There's no great reason why there can't be a .Net equivalant of GWT. GWT doesn't do a 'literal copy' of Java to produce the Javascript - so it doesn't rely on the two languages having a 'similar' grammer. Any language could be converted. Mind you, it would take a lot of effort to duplicate the analysis and optimisation performed by the GWT compiler in producing it's js files.
A more effective route may be to find a C# to Java converter, and then pass the output to GWT.
SharpKit for C# .NET is like GWT but actually does much more. They even have a CLR written entirely in Javascript that provides Reflection, Generics, etc. on the client.
http://sharpkit.net

Recommended open-source software to study C# and design patterns (MVC and others) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I decided to start studying code from other developers to improve my coding skills.
I'm looking for a open-source software that uses MVC pattern, and also most design patterns possible.
Could you recommend some open-source software written in C# or VB.NET that uses as many design patters as possible or some code that worth studying?
I would recommend some projects like NServiceBus, which make extensive use of polymorphism (not to mention the NServiceBus API is one of the best APIs I've had the pleasure of using). Also consider something like StructureMap, which uses a model-based configuration API (I actually use Ninject as my IoC of choice, and it could prove to have some interesting code as well). It's hard for me to point out whether or not these projects use specific design patterns, and how many it may use, but I do know that they use some modern APIs and modern approaches to object oriented design.
I would say, though, that your best bet is going to be to find an open source project that you find interesting, or that you use regularly, and crack it open and see what makes it tick. If you are familiar with the details of using the code (whatever it may be), then you will probably gain more insight be looking at the code because you know what it is doing.
I always recommend .NET Domain-Driven Design with C#: Problem-Design-Solution sample code - SmartCA project. It is extremely elegantly laid out and I find myself going back to it whenever I have doubts about my architecture.
You should also download and check out ASP .NET MVC source code. It's got good examples of unit testing and mocking (which is something you will find yourself wanting to use).
I'd recommend checking out the Northwind Starter Kit (http://nsk.codeplex.com/) - it covers off on many design patterns and their application in the .Net framework, including SOA and MVC/MVP/PM concepts. It also includes examples of several other free-to-use libraries, such as Microsoft Entity Framework and NHibernate.
I'm personally particularly pleased with the way they show the same backend can be used with both WPF and ASP.Net.

Good GIS Software or Components for Windows PC in .NET? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Last week i searched for good free or opensource solutions and component for GIS (Geographical Information Systems) I founded some system but no one fill my requirements
SharpMap is very buggy software
Gmap.net is very slow
MapWindow have a very complex structure and is very buggy.
I founded uDIG but is in java, i need a solution in vb.net or c#.
Anyone know a good solution that fill my requirements or have alternatives, i accept solutions?
You are limiting yourself a lot by insisting on .NET. I don't know of anything other than SharpMap or MapWinGIS ActiveX (MapWindow). Here are some free, but not .NET, options for Windows desktop applications.
If you'd consider writing your standalone application in Python or C++:
Mapnik
QGIS
Or if you'd consider writing a plug-in or a customisation for an existing GIS:
GRASS can be customised in Python, Perl, Ruby...
QGIS can be customised in Python
I think that you've covered it already. There really aren't any production quality open source GIS project out there using C#. Most of the good work is being done in Java, C/C++ or Python these days. If you must use the .NET Framework then I think the best of the bunch is indeed SharpMap.
Failing that you need to look at commercial products from companies like http://www.esri.com. Of course, it also depends on what you need: web services, Windows Forms control, WPF, etc. In the past I've managed to whip up some C# that constructed the right XML to send to a Java server-based mapping engine, so you could look at something like GeoServer and build your own client. Obviously not what you want to get in to but I don't see that you have many options beyond the ones you've listed.
I would recommend to look in to MapAround
Have you checked out SharpMap? It's available on codeplex.
MapSurfer.NET framework might be a good option.
MapSurfer.NET is free, modern cartographic framework which is able to provide maps of superior cartographic quality. This framework supports a bunch spatial data formats (e.g., Shape files, PostgreSQL, OSM, etc.) and web services (e.g., CartoDB, Mapzen, etc.). Furthermore, its setup includes MapSurfer.NET Studio application which allows creating and editing map styles (analogue of TileMill). Its symbology is inspired by both OGC specifications and other similar toolkits such as MapServer, GeoServer or Mapnik.
We use Mapzania (http://www.mapzania.com).
The best thing about it is that you load it into existing web-applications via a NuGet package and then you get a bunch of GIS functionality.
It uses Leaflet as its front-end and it has JS library that makes it easy to do stuff to Leaflet.
It also has a nice MapStyler for creating and editing maps.

CAD/CAM without C++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Is it possible to do CAD/CAM software without having to use C++? My company developed their software with c/C++ but that was more than 10 years ago. Today,there is a lot of legacy code that switching would force us to get rid of but i was wondering what the actual risks are. We have a lot of mathematical algorithms for toolpath calculations, feature recognition and simulation and 3D Rendering and i was wondering if C# can handles all of that without great performance loss.
Is it a utopia to rewrite such algorithms in c# or should that language only deal with UI.
We are not talking about game development here (Halo 3 or Call Of Duty) so how much processing does CAD/CAM really need?
Can anybody enlighten me on this matter? Most of my colleagues are hardcore C++ programmers and although i program in c++ i love .NET but i am having a hard time selling .NET to them other than basic UI. Does it make sense to consider switching to .NET in such a field, or is it just not a wise idea?
Thank you
If you have a lot of legacy code that would need to be rewritten, I don't see it making business sense to switch to a different language. Even if there were gains to be had from using a different language (which is questionable), the cost of testing and debugging the new code would more than overcome them. You also have a development team that are experts in C++. There would be a big productivity drop while they came up to speed on the new language.
C# Can interop with C++ code. You can start writing new code in C# and have it call existing c++ code when needed. It wouldn't have to be just for UI. Look into C++/CLI and the C# Interop methods for information on how to use existing c++ code with new C# code.
Also, I asked a similar question here:
C# Performance For Proxy Server (vs C++)
CAD/CAM applications are fairly calculation intensive, and speed will definitely be one of the criteria for selecting a package, so I would be wary of moving to a slower language.
You need to think very carefully about the reasons for switching language. Is it because you don't like C++, or because C# will bring real benefits. It is quite likely to slow your application down. Check out the C++ C# speed comparisons.
Computer Language Benchmarks Game C++ vs C#
In my humble opinion, you'd be better off keeping all of the toolpath calculations in C++, and if you really must move any code over to another language, move it over to a scripting language which the user can easily edit, without re-compiling.
I use CAD/CAM applications every day at work, and there are a number of things in the UI which get on my nerves. They would be simple fixes if only I could get at the source.
If your company makes a CAD/CAM application which has a UI written in a scripting language which I can tweak (Lua, Python etc), I'll buy a copy.
Hugo
Have a look at pythonocc. Its provides you with a python module that wraps the OpenCASCADE CAD kernel. OpenCASCADE is the sole industry strength open source kernel I'm aware of. Nice features are STEP and IGES support and the ability to generate FEM meshes from BRep data.
Another thing you need to consider is platform independence - if there is a possibility that you/you company need to migrate your CAD software to Linux/Unix (Of course, for bussiness decision), it will be quite painful. Currently, even C++ with MFC/Win32 calls gave us many headache...
The Open Design Alliance library is cross-platform. They have recently introduced a beta of the .NET version of their library. See my answer to Open source cad drawing (dwg) library in C# for more details.
Having said that I concur with the other answers here - if it ain't broken, don't fix it, both the code and the coders. MSFT still use C++, as does the ODA - their codebase originates in C++ & is wrapped for .NET.

Categories