add-ons/extension, how to program? - api

I want to know how to enable the developers to create add-ons for my application like chrome, firefox, blender and VS?
I'm asking here about the concept how the made it? programmatically, what I need to provide in my application with to make this?
any references I may help me?

There is a number of options.
You can embed a scripting language (or an entire VM, like .NET or JVM) into your application, providing a decent API for all the internal functionality. If your application is built on top of such a VM already, chances are you don't need to do anything specific to enable an extensibility, just make sure your API is available and documented. Popular embedded scripting choices are Lua, Python, Guile and Tcl.
Alternatively, for a purely native code, you can provide your API as a separate dynamic linking library, and allow to load third party modules (linked to that library).
You can also make your application modular (split into separate processes), with the components talking to each other over a simple, text-based protocol via pipes or sockets. A very elaborate and powerful infrastructure is available for such an integration option, which is known as the "Unix way". In this case users will be able to choose any way of integrating their extensions with your core functionality.
Choose any, depending on a nature of your application.

Related

Programmable Control of Niagara

How to make an external program control Tridium Niagara framework? I see two options; Which one is correct:
1) Niagara allows addition of 3rd party code to provide an API, and someone else has already done that and we can use it.
2) Niagara allows 3rd party code to do API but we have to write our own.
Niagara installations can be configured to process many different network control protocols driven by an external process across the network, for example by BACnet. The Niagara instance can be configured internally in many different ways to respond to control from across the network.
Niagara 4.x prominently features Web GUIs, including Javascript client widgets and server Javascript, or the server can respond to the Web GUI activity with its other configuration and scripting methods.
For any real complexity beyond the bundled network drivers or HTTP, 3rd party modules coded in Java are used. These would typically be coded as Niagara drivers, processing data over serial or sockets.
Niagara's APIs are mostly open. But Niagara is a complex environment. Completing Tridium's week-long developer training/certification is typically required to produce a proper module.
There are some external API's that Tridium built into AX. oBIX and Bajascript.
I've written external oBIX programs in both Java and Python to pull data from a remote Jace. You'll have to add the oBIX service and export the points you want to see.
Bajascript is a javascript library Tridium uses to interact with the system as well. I believe they released Bajascript 2.0 not to long ago. http://www.bajascript.com
If those don't do what you like, you'll more than likely need to write your own API to handle it.

What are the advantages of using OSGi at target side in a Remote Software Provisioning System?

I am developing a Remote Software Provisioning system that should be able to handle all deployment, installation, un-installation and upgrades of software components. Software can be in any language (java, .net, c/c++ etc) and target side can be PC, embedded systems and smart phones.
I have found Apache ACE as good candidate for developing this system.
I want to know if there is any advantage/necessity of using OSGi at target side as Apache ACE can do software provisioning to non-OSGi targets as well.
Having a modular framework like OSGi at the client side is a huge advantage when doing remote management, because it gives you much insight into what's happening inside - installed bundles, dependencies, states of the bundles, available services etc. This helps a lot when you have to solve a problem remotely. Another advantage is that OSGi basically forces programmers to develop proper modular and dynamic systems, which makes (remote) updating much easier.
So, if you have to decide now what language and framework to use for the client side, I strongly recommend OSGi for the embedded and mobile clients. For the PCs (I guess you mean desktop PCs?) this is probably not the best choice - it depends a lot what you want to achieve there. If you want to install MS Office remotely OSGi won't bring you forward ;)
However, if you already have existing programs at the client side and are discussing whether to convert them to OSGi, I would recommend to investigate some time first to see whether they can be converted easily. Some software packages could give you a lot of trouble converting to OSGi, not because OSGi is complex, but because the program itself is not modular and has a lot of assumptions about the static nature of the environment (e.g. nothing ever disappears, parts of the system never get updated etc.). The irony in the matter is that these are exactly the programs which will give you most trouble later anyway no matter which remote provisioning system you chose.
If you have OSGi at some of the targets be sure to use a remote provisioning system which gives you access to the full OSGi functionality and not only the most basic and simple install and update functions. I haven't yet used Apache ACE, but I have experience with another provisioning system - mPower Remote Manager. Here are some snapshots from the documentation which can give you a feeling what is possible with OSGi as a base - you can draw your own conclusions whether it will be useful for your case or not.
I've given some examples in the other question you asked:
What are the non-osgi targets with which Apache ACE can work
You can write your own management agent that talks to the ACE server and installs artifacts. There actually are a couple of places where you could hook in your own code and protocol. Is there a concrete language/environment you're thinking of using, or are you just exploring the possibilities right now?
Well, the advantages of OSGi haven't changed, so for that I can refer you to the standard page.
To be a bit more constructive, I'll read the question as 'Should I bother converting my application to OSGi, as it is not necessary for ACE?'
I think that depends on what 'kind' of updating mechanism you're after. If you have a monolithical application (at least from the provisioning perspective) which you deploy and update only as a whole (Like an iOS app) then there isn't much to gain for provisioning purposes by using OSGi.
For the rest I can tell you the same as I tell anybody else: Converting an application to OSGi isn't hard, but modularizing code can be a nightmare, but something you'll need to face at some point, OSGi or not. If your code is modularized already, using OSGi should be a piece of cake.

Should I use CORBA, MessagePack RPC or Thrift, or something else entirely?

I'm writing software for a new hardware device which I want any kind of new third-party application to be able to access if they want to.
The software will be a native process (C++) that should be pollable by 3rd party games and applications that want to support the hardware device. Those 3rd party apps should also be able to receive events from the native process, on a subscribe basis. So aside from the native process, I'll also supply "connector" libraries to the 3rd party developers, for all platforms/languages that they might choose (Java, C++, Python etc.) to embed in their apps so they can easily connect to the device with hardly any extra code needing to be written by them. I want to target all desktop/laptop OS platforms, and have a pretty good idea of what functions I want to expose, but ideally I don't want to be too stuck (i.e. I want it to be elegantly scalable from both client and server perspectives).
I'm looking for reliability going forward, performance, maintainability going forward, and cross-platform/language flexibility going forward, and ease of development, in that order.
What should I use?
CORBA, MessagePack-RPC, Thrift, or something else entirely?
(I've omitted ICE because of it's licensing)
Thrift or Message Pack is the best option going forward. Both are sleek, light weight and do not add much latencies to your process. They have support for most of the common languages, and are in Active Development. At the current stage I would prefer thrift personally but message pack does seem to promise a lot of features.
Thought thrift might not be as windows friendly as we want but people are using it on windows.
This is a starter guide for thrift on windows.
http://wiki.apache.org/thrift/ThriftInstallationWin32
Only installing and getting the Thrift compiler can be troublesome on windows. Using the generated files depend on the language you choose and lot of the languages have good support to run the files by importing thrift libraries. (Java it is very easy, MAVEN artifact)
There is a discussion on the RPC frameworks available at RPC frameworks available?
CORBA according to me is old cumbersome and very heavyweight.
If ancient and heavyweight don't put you off, obsolete definitely should. Regardless, I can tell you what we've been using Google Protocol Buffers at work recently, and they're pretty easy to use.
From the developer's perspective, all you need to do is have a build of GPB (which really isn't that difficult), and then it will generate source files for you. The end result is a cross-platform binary message transport message passing interface (think XML and limited RMI, not MPI-like functionality).
We use it on Windows to talk to an Arm-based Linux system (TS-7200's from embedded arm) running the same software. to my knowledge, it is compatible with many languages.
CORBA is the only free "RPC" thing that would work for my system right now, even though it scales very badly. Thrift isn't Windows-friendly yet. Neither is MessagePack-RPC yet available in all languages and OSs, even though it's still in development. If CORBA was elegantly scalable it probably wouldn't have become obsolete at all.
Protocol Buffers and messaging would work, I'd have to develop a both a client and service implementation for every platform/language. It would also be very scalable. I've decided on this.
I'm currently using Apache Thrift for a Hospital Manager project. It is better than CORBA in many areas, not to mention it is lightweight and much easier to implement and understand. The learning curve for Thrift is definitely subtle compared to CORBA, but the documentation for Thrift is the worst thing.
I'm using a Ruby Thrift server to which Obj-C and Java clients connect. The Thrift parser or "compiler" does a pretty good job generating source files for the languages you want, although it is far too verbose. I would definitely look into implementing Thrift, or Google ProtoBuffs if I was starting a new project, since CORBA is really outdated, and might not implement new technologies in the future, not to mention that there are many vulnerabilities and exploits targeting CORBA that will not get patched since it's not in development anymore, presenting some serious security holes on your new project.
Thrift supports many programming languages: C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Objective-C, JavaScript, Node.js, Smalltalk, OCaml and Delphi as of this writing. Supporting multiple languages is key, I think, for the purpose of your project.

Application framework to develop web and desktop applications?

Recently I was asked by someone if there is such a magic framework that will allow one let's say to design and build once a single library of controls and then use them separately to build web and desktop applications.
Does Google, Microsoft or other company have such a RAD framework and tools?
Thx
Depends on how you define a Web App. If you consider RIAs to be Web Apps, then yes...
Microsoft has Silverlight and Adobe has Flex/AIR.
Well, you can always go and look for adobe flex, adobe flash or even microsoft silverlight, which in the next version will support desktop applications as well.
Other types of frameworks currently do not build so well under desktop/web environments.. Take .NET for example, which can be used in so many set of environments, but there are limitations if you want to use it for mobile, web, desktop or XNA, everyone has his own set of tools.
That is mostly resumed in the capability of the desired environment, since you can browse a web page in an iphone, which does not have the same capabilities of a desktop or even laptop PC.
Seva is telling you how this is normally dealt with. MVC is a good start.
The Eclipse foundation offers Rich Client Platform vs Rich Ajax Platform - one allows you to build desktop apps, the other web-based apps, all using SWT concepts. I wouldn't describe it as magical though - the reality is it is much more difficult and I would not recommend RAP.
Adobe has AIR, and Google wants everybody write HTML5+JavaScript. both Chrome and FireFox can run those as standalone apps.
Were such thing to exist, it would produce lousy desktop apps and lousy Web apps. The underlying platforms and ideologies are too different. You'll do better by isolating as much of business logic away as possible, then building two separate clients.
EDIT: assuming that by a "Web app" you mean an HTML-based app, as opposed to something that happens to execute within a browser. For the latter option, you can have Flash, Silverlight, Java Applets, ActiveX controls... And for the vice versa, you can have a desktop app that opens a Web browser control and runs a Web app in it. :)
Microsoft has a Smart Client Factory that has a lot of built-in guidance packages that make development fairly quick and standardized.
http://msdn.microsoft.com/en-us/library/aa480482.aspx
It is entirely possible that I misunderstand this question, but if all you need, is the ability to seperate models an business logic into some kind of reusable library, just about any programming platform/language will do.
Java: keep models and business logic in seperate project, compiled to jar
.NET: keep models and business logic in seperate project, compiled to DLL
Python, Ruby, Perl: keep models and business logic in separate directory, and include as module
What are the requirements for the desktop application? On which platforms should it run? If Windows only, .NET seems like an obvious choice, otherwise Python and Qt or Java if you like to Swing.
I also would go for a Webservice and implement as much Business-Logic as possible in the Service. You can then build a very small Clinet in Html/JS, Java, .Net or Whatever.
You should choose that Framework you feel most familiar with.
If you are a .Net-Developer you can develop a WCF-Service (is also great with WP7).
For Java, i would choose Google-App-Engine or the Play-Framework.
And of course you can make a PHP-Webservice, for examble with the Flow-Framework
Check CrossUI RAD tool. It enables developers to rapidly develop and package the exactly same code and UI into Web Apps, Native Desktop Apps(Windows, OS X, Linux and UNIX) as well as Mobile Apps.

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

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 collaboration etc.
i have looked at some technologies but all seem to have some disadvantages
Adobe AIR 2
Advantages
Use of existing web technologies make it easy for me (mainly a web developer) to design and develop applications based on HTML5, CSS3, JS (jQuery, Dojo) which can be ported to a web platform in the future with greater ease
can access file system
Disadvantages
i guess speed maybe an issue
i may encounter limitations with what can be done in JS (vs languages like C#, Python, Java etc)
C#/F#/WPF/EF/LINQ
Advantages
C#/F# powerful languages
EF/LINQ makes data access very simple
WPF provides good data binding, styling capabilities
Disadvantages
WPF harder to use/learn than what i already know (HTML/CSS/JS)
WPF abit more complex
Harder to port over to a web platform (... maybe with a .NET platform its still ok? but i think Open Source PHP/Apache is more widely used)
Silverlight (Out of Browser)
Advantages
C#/F# more powerful than JS
Disadvantages
complexities of WPF vs HTML/CSS
Mozilla Framework
i dont know much about this option yet
Advantages
XUL as a layout tool, i guess provides more flexibilities than HTML?
uses CSS/JS existing web technologies so porting maybe still quite straightforward
i think it can use native API/Code tho i dont know how it works yet
in general, i think it will be a more powerful option over adobe air
Disadvantages
Architecture of software seems messy, chrome folders etc? i think WPF seems like a much more powerful and elegant option compared to this?
i have seen QT-Webkit too, but same as Mozilla Framework, WPF seems like a much more powerful and elegant option
just FYI, i am thinking of building a Project Management/Organizer type application. most parts of it i think it will work on a web platform except i wanted to integrate features like screen capture, managing project files, resources (eg. web site inspirations, resources like fonts, videos, etc). i am also exploring Adobe XMP to add metadata to files (images, videos etc).
You might consider Adobe Air or Silverlight which are platforms that allow an application to run on the desktop or web. There is also an open-source alternative called Titanium that, like Adobe Air, is also multi-platform.
You can also use OpenLaszlo which uses flash.