How can i protect parts of code in my Open Source project licensed under GPLv3? - open-source

I am creating an Open Source project but I'd like to protect just some parts of my code (mainly these ones related to security). I am using the GPLv3 license. How can I achieve this?

It is indeed possible to split your project up into multiple modules, each of which has a different license. To the best of my knowledge there is nothing preventing a GPLv3 licensed project to use proprietary software. You should however consider using documented interfaces or the equivalent in your programming language of choice so that others who want to reimplement your proprietary code aren't tortured unnecessarily. Ideally you code still compiles but may be limited in or devoid of functionality without that proprietary component.

Related

Best portable development platform for small personal project

I'm looking for a development platform (language and set of libraries) that will allow me to develop a personal project. (In case anyone is curious, I'm looking at making a music library manager, similar to iTunes, that can work on multiple platforms and sync with Android devices).
I want the language to have the following characteristics:
Essential
The program must run flawlessly, with no (or very little) code changes on Mac, Linux, and Windows. That means, notably, that I need to have a cross-platform GUI framework, a consistent API for accessing files and directories, and a consistent interface for talking to USB storage devices
Important
A language that is easy to use, powerful, and expressive. Big standard libraries with a lot of built-in functionality. (I'd probably use C#/.NET but the portability isn't great)
Nice to have
Good tool support (on Linux if possible, but I'll do my development on Windows if needs be)
Not Java. (I have used it and just don't like it - I'm not interested in getting into a language war here).
Please help me choose a language!
Python
Cross platform GUI: more than one option, I'd use WxPython, but Qt bindings are also available (comparison between wxWidgets and Qt).
File System API: this gets into the os package, but there are also convenience methods for just dealing with I/O.
USB I/O: I confess to not having any knowledge here, but suspect if you're talking storage that Python will be able to read and write using its IO package.
Libraries, Ease of Use, etc..: there's a lot built in, but also a huge number of add-ons (called "packages"). Some of the most notable are SciPy and NumPy, used for scientific and numerical analysis.
Tooling: there are a number of IDEs out there, I use PyDev (but it's Eclipse based so you probably won't like it if you don't like Java).
Finally, Python is supported on Android via its scripting environment.
For cross platform GUI, you can explore QT. The back-end can be on c.
Have you explored anything so far?
Qt quick ?

Delphi with HTML/CSS interface

I want to develop a delphi application with an HTML/CSS graphical user interface, not necessarily running from within a web browser. I want to do this do create a richer graphical user interface with animations etc. and break away from normal VCL components / Windows look. Any suggestions?
HTML and CSS won't deliver animations or a Rich User Interface to your feet. Far from it in fact. Quite the opposite. You will need to invest in a toolkit to provide that sort of functionality and almost certainly involve JavaScript. And even if you don't want your eventual application hosted in a web browser, your application will itself have to host a web browser to render your HTML/CSS/JavaScript UI, and you will then have a much more difficult job of connecting your GUI to your application logic (unless you do actually embrace a web application architecture).
Delphi (or any Windows application development language for that matter) gets you much, much further down the road towards a more simply, effectively and quickly implemented Rich User Interface than HTML or CSS.
If you don't like the look and feel of the standard Delphi controls (which in essence is what you are saying) there are numerous alternative libraries available.
Also bear in mind however that when someone uses a Windows application they expect it to look and behave a certain way to a large extent. Using fancy, web based paradigm's in a desktop application simply for the sake of it is likely to confuse and frustrate users if taken too far.
I'm all for user interfaces breaking with convention where it leads to a more intuitive user interface, but simply being "prettier" does not necessarily lead in that direction and is just as misguided as dogmatically adhering to convention.
In one of my applications I have an an embedded browser and I have implemented the IDocHostUIHandler interface. This allows me to expose a COM object via the "GetExternal" method. I simply have a COM object that exposes methods and properties of my application which makes them available to the web pages hosted inside the embedded browser.
So the script in my web pages has lines like "external.DoSomething()" and "i=external.GetThisValue()". So, for example, behind button onclick events you can run a method of your application (implement in the main form, in the COM object itself, or whatever you like).
This site has lots of info on embedding a browser in your Delphi app:
http://www.delphidabbler.com/articles?article=22
It can certainly be cumbersome to implement a lot of this stuff and in many cases there are probably better options. But for my specific purpose I am able to offer a "home page" which can easily be modified to change its layout, look and even expose more (or less) functionality as required by myself or my users.
If you want a Delphi program with a better-looking interface, HTML is really not what you're looking for. What you really need are better-looking VCL controls.
Take a look at TMS Smooth Controls, for example. If you're on Delphi 2009 or 2010, you can get it as a free download here. That's one of many component libraries that can bring a slicker user interface to your program.
HTML / CSS offers some nice features which are (not yet?) available in Delphi and the VCL. They are also a good starting point for client/server programming, separating the user interface and the business logic is a key factor here.
One popular library for Delphi is the extpascal project:
ExtPascal is an Object Pascal (Delphi,
FreePascal/Lazarus) wrapper/binding
for Ext JS, a complete GUI Ajax
framework, made in JavaScript, for
Rich Internet Application (RIA)
development. ExtPascal lets you use
Ext JS from Object Pascal commands
issued by the server. It brings the
structure and strict syntax of the
Object Pascal for programming the web
browser. ExtPascal will wrap Draw2d
into future releases.
Some demos are online here and here.
p.s. and I really like the HTML / CSS support for element and font sizes in relative units (for exampe percent). Combined with browser zoom in / zoom out and WCAG, user interface ergonomy can not be much better.
HTML Option 1
If you relly want to use HTML+CSS(+JavaScript) to build a GUI, you can have a look at HTML Applications, a very fascinating concept from Microsoft. HTML Applications, .hta files, have been supported from Windows ME, if I remember correctly, and they are still supported on Windows 7.
You could create an HTML Application (i.e. an HTA file), and by so doing, creating a GUI using only HTML, CSS, and JavaScript. When the user double-clicks the HTA file, it will open like a program, but the GUI is entirely based on HTML; in fact, the entire Window is an Internet Explorer window in disguise.
And now comes the important part: you could create non-GUI Delphi applications (i.e., Delphi applications that are not console applications, but that have no forms either), and start them via hyperlinks (or JavaScript) from within your HTA GUI. (Well, it is probably better to create one such Delphi application, and use command-line arguments (ParamStrs) to communicate the desired action.)
Just an idea...
HTML Option 2
Alternatively, you could create a normal Delphi GUI application, but fill the entire main form with a TWebBrowser (a IE control), using Align := alClient. Then you could either load static HTML pages (stored in the Program Files folder or on the Internet), or you could use Delphi to dynamically create HTML pages to show. I think it is possible to intercept links from the control, so that you could respond to links using Delphi code.
What about OpenGL?
If you want to "break away" from the normal Windows look and feel, then I would recommend you to create your GUI using OpenGL. It is very easy to make a Delphi application with OpenGL (as long as you are familiar with OpenGL) - just add "OpenGL" to your uses list.
First this: I completely agree with Deltics' answer.
Having said that, if you master HTML and CSS (and JavaScript and AJAX etc etc) and you are looking for a way to use the power and speed of the Delphi compiler to run the dynamics of a website, this may be of interest.
I've created a project that uses the Delphi compiler to build a library that runs a website. The source-files combines HTML and Delphi, much like other web-scripting tools out there, but gets processed on a page-refresh, and compiled automatically. It uses a 'library handler' that plugs in the website library into pretty much anything you like: IIS, Apache, a stand-alone HTTP server (for hosting), or directly into InternetExplorer or FireFox (which is great for developing).
http://xxm.sourceforge.net/
New versions of Qt contain ability to use html/js for interfaces. I don't know if there is Qt library bindings for Delphi, but Qt is exactly what you want.
for Rich GUI and animation, have you looked at KSDev DXScen and VGScene ?
If you want to keep your delphi/Pascal Object 'background' and have a Web like RIA you also have a look to Morfik : link text

What are the steps in licensing a library? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I wrote a library and I would like to make it open-source, but I am afraid of others stealing it and taking ownership of it. I am very new to licensing software.
What should I do and what are the steps in licensing my software.
Well the first step is choosing what licence you want to release your software under. The Open Source Initiative has a useful page listing a lot of them and there's a good comparison on the KDE web site. There are lots of different options - you need to work out what you're happy for other people to do with your code. Are you happy for it to be included with commercial applications without the source code? Modified without changes being contributed back?
Then you just need to work out what the licence requires - you may just need to include a licence.txt file with the software, or apply a comment at the top of each source file.
Find an appropriate hosting site which is happy to use that licence, and you're away.
GNU Library License
Read LGPL.
Alternatives
There are many other licenses from which you can choose.
Application
Usually it is sufficient to include documentation in the header of all source files that refers to the licensing conditions. As well, it is common to include a text file containing information about how the software can be used.
Software Theft
Once publish your software under an open-source license, typically that grants everyone the right to use the code for any purpose they desire. Normally you needn't be concerned because that is the point of releasing the source code. In fact, you want to encourage others to take your software and use it. Something that is given away for free cannot be stolen.
Ownership
The real concern here, in my mind, would be people taking the software and claiming it as their own. It happens (DVD Jon, Microsoft, and SCO to name a few), and there is not much people can do about it.
If your concern is about people branching your software to create other versions, that seems more like cause for celebration. It implies that your software has been well received, so well that other people want to take it in directions that they feel solve a different niche of problems. This should be encouraged.
No matter what happens, though, you will retain ownership of whatever you produce under copyright law (at least in Canada and the United States).
Remember to consult your friendly neighbourhood IT-specialized lawyer for advice.
Custom License
Also, even if you release the source code under an open-source license, it does not mean that that is the only license you may associate with the source code. It is entirely possible that someone will approach you requesting different terms. For example, they might want to create and share a proprietary solution that uses your technology, without having to release their changes to the world. You might choose to offer them a commercial license under mutually agreeable terms and conditions.
Be careful, though: third-party contributions donated to your project, under the terms of the open-source license, are not yours to distribute under a different, custom license. If you want the flexibility of creating a custom license, you must have the ability to identify and extract your personal contributions.
If it's open source, you are relying on the honour of the people who use it, whatever form of preamble you put in each file and include with the distro bundle.
You probably want to start with the OSI licensing page.
If you make your code open source, you are explicityly allowing other people to do pretty much anything they want with it, with in the case of GPL some restrictions on what they must do ifv they choose to distribute it. This is not "stealing". If this worries you, don't make it open source.
If you want the source code to remain free but you don't require the software using your library to be free, you should use the LGPL library. Link
Otherwise, if you want the software using your library to be free, go for the classic GPL. Link
If you are afraid people can steal your work, well, maybe free licences aren't for you :-)
Instead of stealing them, they may use your code, enhance it, redistribute it etc. If you don't know much about this philosophy read here
You can start by looking at the GNU "How to use GNU license for your project" page.
However, the whole idea of open-source is sharing your code with other people. If you're afraid of "others stealing it" - keep it under your hat.
When you licence your library you still retain the copyright. The licence governs what people can and cannot do with the library. You can select from many different open source licences. Without knowing anything about how your library is intended to be used, I'm going to make the assumption that it needs to be compatible with a proprietary licence.
MIT
Permit anyone to freely use without restrictions.
LGPL
Permit anyone to freely use provided modifications are made available.
I strongly encourage you to read the terms of these licences.

Needed: Light and free HTML editor with source control support

We're not doing real web development. We get our HTMLs from our designers, and have our web app generate those HTMLs (with some specific content). Simply put, we don't use any major web development infrastructure (ASP, PHP, JSP etc). Having that said, we sometimes do need to edit HTML, JavaScript and CSS files, and I'm tired of using rocks and stones and having no proper backup. What I'm looking for is a rather simple editor that would handle those kinds of files, and most importantly - will support source control, and will be free (or very cheep).
I've been looking into Aptana, and it seems to be a bit of an overkill. It has a lot of features we can do without, and this makes it too heavy. VWD express is lighter, but has no source control integration. There are probably a million other HTML editors, but I couldn't find one that satisfies the basic requirements - relatively lightweight, supports source control and is (almost) free. Any suggestions?
Not exactly what you want but you could try and use Notepad++ combined with TortoiseSVN.
Eclipse is pretty good. It's also very popular among developers and can edit HTML.
Why is supporting source control a requirement? I find that the place for good source control is not in the editor. The editor just gets in the way and only implements a subset of functionality.
NetBeans can edit about anything, is free, cross-platform, and directly supports CVS, Subversion and Mercurial version control systems. It's not exactly lightweight, although it is lighter than any comparably featured competitors I'm aware of.
Pick your poison at Wikipedia's Comparison of HTML editors page.
The Revisionator is a cloud based html editor that has built in source control. It'll even do wysiwyg diffing and merging of different versions.

How to design extensible software (plugin architecture)? [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 6 years ago.
Improve this question
I need some resources that talk about how to design your software to be extensible, i.e. so that other people can write add-ons/plug-ins that adds functionality to it.
What do you recommend? Any books out there that discuss the subject?
I would prefer something that's short and to the point; a bit of theory and a bunch of concrete examples.
I'm not targeting a specific language, I want to be able to understand the core idea so that I can implement it in any language.
And for the same reason, I prefer not to do it using a framework that someone else built (unless the framework is not very high-level, i.e. doesn't hide too much), at the moment I only want to educate myself on the subject and experiment with various ways to implement it. Plus, a framework usually assumes user's knowledge about the subject.
UPDATE
I'm not asking about OOP or allowing my classes to be inherited. I'm talking about designing an application that will be deployed on a system, such that it can be extended by third-party add-ons AFTER its been deployed.
For example, Notepad++ has a plug-in architecture where you can place a .dll file in the plugins folder, and it adds functionality to the application that wasn't there, such as color-picking, or snippet insertion, or many other things (a wide range of functionality).
IF we're talking .NET, try Scripting .NET applications with VBScript over on CodeProject. Lots of concrete examples there.
Below are sites implementing various application extension techniques
ClearScript - Makes V8, VBScript and JScript available to .NET apps
CS-Script - The C# Script Engine
Plugin Architecture using C#
Opinio plugin architecture
Notes on the Eclipse Plug-in Architecture
Plug-in Architecture Framework for Beginners
Gecko plugin architecture
Fungimol plugin architecture
OSGI is a good practical example of a technical framework allowing to do what you are after.
The theory is here.
The (free!) book is there.
Extensibility and the ability to write plugin must deal with service lifecycle
adding / removing service/plugin on the spot
managing dependencies between services
managing states of services (declared, installed, started, stopped,...)
What is OSGI for ?
One of the main functions of a module is as a unit of deployment… something that we can either build or download and install to extend the functionality of our application.
You will find a good introduction here, on the central notion of service (which is related to your question, and which explain some problems around services, key component for extensibility).
Extract:
Why are services then so important if so many applications can be built without them? Well, services are the best known way to decouple software components from each other.
One of the most important aspects of services is that they significantly minimize class loading problems because they work with instances of objects, not with class names. Instances that are created by the provider, not the consumer. The reduction of the complexity is quite surprising
Not only do services minimize configuration, they also significantly reduce the number of shared packages.
Implement SOLID principles in your application.
1. Single responsibility principle: A class should have only a single responsibility (i.e. only one potential change in the software's specification should be able to affect the specification of the class
2.Open/closed principle: Software entities … should be open for extension, but closed for modification
3. Liskov substitution principle: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program
4. Interface segregation principle: Many client-specific interfaces are better than one general-purpose interface
5. Dependency inversion principle: One should Depend upon Abstractions. Do not depend upon concretions
Stackoverflow questions:
Example of Single Responsibility Principle
Is the Open/Closed Principle a good idea?
What is the Liskov Substitution Principle?
Interface Segregation Principle- Program to an interface
What is the Dependency Inversion Principle and why is it important?
You try to reach two competing goals:
The components of your software must expose a lot of themselves, so they can be reused
The components of your software must expose very little of themselves, so they can be reused
Explanation: To encourage code reuse, you should be able to extend existing classes and call their methods. This isn't possible when the methods are declared "private" and the classes are "final" (and can't be extended). So to meet this goal, everything should be public and accessible. No private data or methods.
When you release the second version of your software, you will find that many of the ideas of version 1 were plain wrong. You need to change many interfaces or your code, method names, delete methods, break the API. If you do this, many people will turn away. So in order to be able to evolve your software, the components must not expose anything that is not absolutely necessary - at the cost of code reuse.
Example: I wanted to observe the position of the cursor (caret) in an SWT StyledText. The caret is not meant to be extended. If you do it, you'll find that the code contains checks like "is this class in the package org.eclipse.swt" and a lot of methods are private and final and whatnot. I had to copy about 28 classes out of SWT into my project just to implement this feature because everything is locked down.
SWT is a nice framework to use and hell to extend.
Of course there is the famous Open Closed Principle - http://en.wikipedia.org/wiki/Open/closed_principle
Well it depends on the language.
In C/C++ I'm pretty sure there is a loadlibrary function that allows you to open a library at runtime and invoke it's exported functions. This is typically how it's done in C/C++.
In .NET, there is Reflection, which is offers similar (but more broad) to loadlibrary. There is also entire libraries built on Reflection like Managed Extension Framework, or Mono.Addins that does most of the heavy lifting for you already.
In Java, there is also Reflection. And there is the JPF (Java Plugin Framework) which is used in stuff like Eclipse IIRC.
Depending on what language you use I could recommend some tutorial/books. I hope this was helpful.
Plugin architecture is becoming very popular for its extensibility and thus flexibility.
For c++, Apache httpd server is actually plugin based, but a concept of module is used instead. Most of apache features are implemented as modules, like cache, rewrite, load balancing, and even threading model. It is a very modular software I ever saw.
And for java, Eclipse is definitely plugin based. The core of Eclipse is an OSGI module system which manage bundles, another concept for plugin. Bundle can provide extension points on which we can build modules with less efforts. The most intricate thing in OSGI is its dynamic characteristic, which means bundles can be installed or uninstalled at runtime. No stop-the-world syndrome any more!
Since I dont have enough rep points to leave a comment, I am posting this as an answer. SharpDevelop is an IDE for developing applications in C#/VB.NET/Boo. It has a pretty impressive architecture that allows itself to be extended in a number of ways - right from new menu items to development support for whole new languages.
It uses a bit of XML configuration to act as a glue layer between a core of the IDE and the plugin implementation. It handles locating, loading and versioning of plugins out of the box. Deploying new plugins is matter of simply copying in the new xml configuration file and the required assemblies (DLLs) and restarting the application. You can read more on this in the book "Dissecting a csharp application" by the original author(s) - Christian Holm, Mike Krüger, Bernhard Spuida of the application from here. The book doesnt seem to be available on that site, but i found a copy that might still be around here
Also found a related question here
Checkout "CAB" - Microsoft's Composition Application Building blocks Framework. I think they've got a "web version" of that too...
I have just started to develop a smart client application. These are two options I am considering.
Using Microsoft's System.AddIn namespace. Looks very promising, however it may be a little complex for our end solution.
Or the Smart Client - Composite UI Application Block from Microsoft
Recently, i have looked at taking components both the Composite UI Application Block and the System.AddIn namespace to build my own. Since source code is available for the CAB it is easy to extend. I think our end solution will be a light weight version of the CAB, definatly using the Unity Application Block
If you work with .Net, our research yielded two approaches: scripting and composition.
Scripting
You extend the functionality of what your classes can do by orchestrating them using scripts. That means exposing what is compiled in your favorite .Net language in a dynamic language.
Some options we found worth exploring:
IronPython
IronRuby
JavaScript: Jint, Jurassic and JavaScript .Net are good starting points.
Script.Net -> this one was the first one to call our attention.
Composition
If you start a project with .Net 4 or above, you must take a good look at the Managed Extensibility Framework (MEF). It allows you to extend the functionality of your apps in a plugin way.
The Managed Extensibility Framework (MEF) is a composition layer for
.NET that improves the flexibility, maintainability and testability of
large applications. MEF can be used for third-party plugin
extensibility, or it can bring the benefits of a loosely-coupled
plugin-like architecture to regular applications.
Managed Add-in Framework is also a good read.
MSDN: http://msdn.microsoft.com/en-us/library/dd460648.aspx
Codeplex: http://mef.codeplex.com/
Rather than re-inventing the wheel, use the frameworks in hand. Eclipse and Netbeans both support plugin based extensions. You have to work in Java though.