Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Wednesday, October 22, 2014

What qualifies a Project to be a Product?

Disclaimer:
This post is based upon a piece of dream (not fiction). Any relation to any enterprise grade product is purely coincidental.

---

Now, this is not a flame post against Proprietary Software. I'm a FOSS supporter but with understanding that for some Business... 
* paid 24x7 support is a lot more critical than quality
* need to put trust in a product where the Vendor is bound by agreement to help
which is perfectly fine.
Depending on a business requirement and policies, there need to be different solutions provided. Some community supported FOSS and then many large corporations (backed for years) Enterprise Software.

Again, no this post is not on license of software.
This post is on some core values of a software (FOSS or Proprietary) that make it eligible to be used at a worthy scale in a Organization that is depending on it.
These also stand true for any user of that Software Project, but are more crucial for users depending their economy on it.
And are ethically right of the Corporations which are paying big bucks for a piece of code sold to them on high brand and big promises.

Here on I use "Products" for all paid-for (some Enterprise grade) Projects that I got to work on since college and experience the truth underneath.
---

So... What qualifies a Project to be a Product?

  • 2 old-skool fundamental mantras: loose coupling; high cohesionThere are "Products" with bunch of modules that have separate responsibilities. Correct approach. But when you start to build around them, sometimes they are not that independent in containing self responsibilities.
    That's worse than not having your project modular at all, at least that way you promote users to treat it as a black-box.
    "Product" need to be well modular-ized emitting the age old beautiful development practices of keeping your modules loosely coupled, strongly cohesive.
  • isolated from client specific details
    Anything and everything that depicts details about client specific implementation need to be managed as a configuration provided explicitly. There shouldn't be any necessity of find-replace any hard-coded "config text" in source or set-up files for the "Product". These details shan't be required to be packaged with custom traditional set-up of "Product".
  • generic out-of-the-box setup... tested and isolated
    The "Product" installer binaries shall be self-contained. They can be O.S. distribution specific, which is fine.
    They should be unaffected of O.S. level restrictions that may be there or not. Say if SELinux is enabled, your setup shall be able to initiate changes required for the "Product" to function.
    Any dependency shall be either bundled in the installer package, or shall utilize the targeted package manager to lay it down for itself.
    The installer shall be tested completely in the mode it is supposed to be used. For example, if it sets up the machine remotely then it shall be capable of handling all tasks remotely by itself and not depend on user to place some files for it first or in-between.
  • no mesh between services required for initiation
    The "Product" might have distributed architecture support, might have modular components collaborating.
    Now these distributed components need to be aware of each other to be able to collaborate. The components shall be robust enough to handle unavailable dependency components and regain activity once available.
    This awareness can be maintained on a component dedicated to dynamic configuration query and update, where all component instances export details about self and gather information on others. Environment preparation mechanism can populate the initial dynamic information which on requirement can be updated in collaboration-enabling component and gathered by others.
    Every component can persist information required for it within itself as well, but that shouldn't be dependent on the other components. If component-F collaborates with component-A and requires component-A to mark some activities for it even to start itself. Bad design.
  • don't promote deprecated technology in newer component
    Some "Product" have big lifetime, depending on their vastness &/or critical nature. This might lead to existence of certain obsolete technologies (like SOAP in yr2014) usage in newer components.
    You shouldn't start rebuilding entire perfectly working "Product" for that, yes. But neither shall you use that as an excuse for holding back entire new development around it. It will cripple the "Product" much faster of surviving in newer circumstances if it can't use the power required for them.
    Build a mid-layer contract API and seclude your new work over your legacy "Product". Then build new features over that mid-layer API.
    This will help you avoid "Product" becoming a bloatware just because new features can't be used inherently from the design itself. It will also help contain the sanity of perfectly working "Product" from some (library, etc.) changes required for new features. And will let you use more advance current best practices for all the newer work, not cripple it.
    If not "Product" in entirety; at least every individual component in itself shall follow unified design/development/interface/platform strategy... it shouldn't have bifurcation of ideals, if necessary a new component shall be carved out and plugged-in instead of corrupting the existing piece.
  • different style of code, different degree of documentation
    If your code-base is not very huge, beautifully written clean and modular code can survive without documentation.
    If your code is not clean (don't judge it yourself, ask someone expert in language/framework but unaware of logic to guess) then have freaking documentation all over it.
    If your code-base is "really" huge, even if your code is mostly clean... have a basic module level documentation at least.
    So anyone using it knows how to handle them and build upon or around them. Anyone visiting the code-base many years after (if you think your "Product" is capable) with lot improved language features is still able to make sense of what was carved with stone on cave walls.
  • building upon/around it shouldn't involve hack-y ways
    In small home-brewed solutions, unpack-replace-repack is still arguably accepted solution.
    In a freaking "Product", it shall expose an elegant yet secure API interface to extend features. If it allows overriding of existing features, even they shall be plugged in via that interface causing the built-in feature to be subdued.
    It's not effortless but is a sane and secure method. The "Product" need this embedded in it's design.
  • for all kinds of data-set involved, should have a proper data-modification strategy
    Hand modification seem harmless at development stage, even at testing sometimes. In production if any kind of data modification done during setup or updates doesn't have a migration/rollback strategy around it, it's a danger zone signal.
    Like proper DB migration scripts over (and not plain diffs of) current version of scripts. I might seem obvious as all other points, but there are bunch of Product missing one or other variations of it.
  • take care of sensitive data involved even during setup of "Product"
    If your Product in any manner forces display or storage of sensitive data (usernames, passwords, machine names, network details, yada yada yada), danger zone again.
  • have at least some level of sanity tests for all logic flows
    Even in this age of software development, if importance of software testing (acceptance, regression, security) need to be advocated to you, it's disaster.
    To state obvious... any change can be tracked properly, all technologists have some level of idea and trust on what's where doing what, people picking it much later can build over it without breaking anything.


and some things, but that for some other time.....

---

LONG QUESTION:
Could a piece of software sold by "so called tech moghul" Organizations be so crappy that the only purpose it fills is vendor lock-in for years of licensing and not even the creators know it's buggy to its core?
SHORT ANSWER:
Yes! So chose with care.

Saturday, March 24, 2012

xml-motor ~ what it is; how & why should you use it

xml-motor ~ what it is; why & how you should use it

Download this article as pdf on what,why,how
http://speakerdeck.com/u/abhishekkr/p/xml-motor-whatwhyhow-this-xml-parsing-rubygem#


or read it all here.....

Late 2011, I started with a new rubygem project for parsing xml, html content.
  @Rubygems: http://rubygems.org/gems/xml-motor
  @GitHub     : https://github.com/abhishekkr/rubygem_xml_motor

Just created it to test out my work at compact, quick & easy xml-parsing algorithm... can see that
  @Slideshare: http://www.slideshare.net/AbhishekKr/xmlmotor

So, currently this is a non-native, completely independent less-than-250 ruby-LOC available as a simple rubygem to be require-d and use in an easy freehand notation and match with any node attributes.

Current Features:
  • Has a single method access to parse require xml nodes from content or file. Use it only if you are gonna parse that xml-content once. For using same xml-content more than once, follow the 3-way step mentioned in examples.
  • It doesn't depend on presence of any other system library, purely non-native.
  • It parses broken or corrupted xml/html content correctly, just for the content it have.
  • Can parse results on looking for node-names, attributes of node or both.
  • Uses free-freehand notation to retrieve desired xml nodes
    if your xml looks like,
    '<library>...
      <book> <title>ABC</title> <author>CBA</author> </book>...
      <book>
        <title>XYZ</title>
         <authors> <author>XY</author><author>YZ</author> </authors></book>...
    </library>'

    and you look for 'book.author',
    then, you'll get back ['CBA', 'XY', 'YZ'];
    what that means is the child-node could be at any depth in the parent-node.
  • Default return mode is without the tags, there is a switch to get the nodes.
    as you'd have seen in above example:
    'CBA' gets sent by default, not 'CBA'
  • To filter your nodes on the basis of attributes, single or multiple attributes can be provided.
  • These attribute searches can be combined up with freehand node name searches.
  • Readme (a bit weird): https://raw.github.com/abhishekkr/rubygem_xml_motor/master/README


Features To Come:
  • Work on making it more performance efficient.
  • Limit over result-nodes retrieved from start/end of matching nodes.
  • Multi-node attribute-based filter for a hierarchical node search.
  • Add dev-knows CSS Selector, it's already present using attribute based search... just need to add a mapping method.


EXAMPLES of usage:
example code to try: https://github.com/abhishekkr/axml-motor/tree/master/ruby/examples
  • say, you have an xml file 'dummy.xml', with data as
    <dummy>
      <ummy>    <mmy class="sys">non-native</mmy>  </ummy>
      <ummy>
        <mmy class="sys">      <my class="sys" id="mem">compact</my>    </mmy>
      </ummy>
      <mmy type="user">    <my class="usage">easy</my>  </mmy></dummy>
  • its available at rubygems.org, install it as
      $ gem install xml-motor
  • include it in your ruby code,
      #!/usr/bin/env ruby
      require 'xml-motor'
  • get the XML Filename and/or XML data available
      fyl = File.join(File.expand_path(File.dirname __FILE__),'dummy.xml')
      xml = File.open(fyl,'r'){|fr| fr.read }
  • One-time XML-Parsing directly from file
      XMLMotor.get_node_from_file(fyl, 'ummy.mmy', 'class="sys"')
         Result: ["non-native", "\n      compact\n    "]
  • One-time XML-Parsing directly from content
      XMLMotor.get_node_from_content xml, 'dummy.my', 'class="usage"'
         Result: ["easy"]
      
  • Way to go for XML-Parsing for xml node searches
      xsplit = XMLMotor.splitter xml
      xtags  = XMLMotor.indexify xsplit


      [] just normal node name based freehand notation to search:

        XMLMotor.xmldata xsplit, xtags, 'dummy.my'
        Result: ["compact", "easy"]
      [] searching for values of required nodes filtered by attribute:
        XMLMotor.xmldata xsplit, xtags, nil, 'class="usage"'
        Result: ["easy"]

      [] searching for values of required nodes filtered by freehand tag-name notation & attribute:

        XMLMotor.xmldata xsplit, xtags, 'dummy.my', 'class="usage"'
        Result: ["easy"]

      [] searching for values of required nodes filtered by freehand tag-name notation & multiple attributes:

        XMLMotor.xmldata xsplit, xtags, 'dummy.my', ['class="sys"', 'id="mem"']
        Result: ["compact"]

Thursday, October 20, 2011

http_voodoo_mongo ~ remote control your MongoDB over HTTP

@github: https://github.com/abhishekkr/http_voodoo_mongo

project name: http_voodoo_mongo
platform:     linux
requirement:  ruby

usage: it's a remote controller for your local/remote MongoDB instances working over an HTTP mocking service

What it consists of?

[] a rakefile 'Rakefile' allowing you to auto install and start 'http_voodoo_mongo' as a system service using "rake http_mongo:install" task.

[] a ruby script 'mongo_voodoo.rb' which mocks HTTP Server and allows you control MongoDB using HTTP Requests.

[] a system service script 'mongo_voodoo' which enables you to start||stop||status||restart the Ruby Script as a System Service

*currently I've just added "mongodump" task to it (with & without authorization detail), will slowly add more..... it's all opensource, even you can update if you want


======================================================
a REST API for Remote Controlling MongoDB Server over HTTP using the same 'authentication' as of MongoDB Server

[] need to access the service at HTTP_URL => http://[MongoDB_IP]:30303/

[] Optional GET Request Parameters [name] the username permitted access [pass] the password linked to username [port] the port at which MongoDB Server is running

 ::MongoDB Database Backup 
  http://[MongoDB_IP]:30303/[db_name]?action=dump&dir=[dir]&more_switch=[more_switch]&userniame=[username]&password=[password]&port=[port] 

[] GET Parameters [dir] the directory to take in backup using mongodump [more_switch] any options you wanna add to mongodump command 
======================================================

Thursday, July 28, 2011

derailed_cuke ~ now test any website using cucumber as an independent testing utility

GitHub Linkhttps://github.com/abhishekkr/abk-labs.cucumber
[] What is "Cucumber"?
+ http://cukes.info/
Cucumber lets software development teams define the behavior of any application in Business Readable DSL as plain text.
Hence serves as documentation, automated tests and development aid ~ All In One.


[] What is "derailed_cuke"?
+ Project Repo @GitHub


[] How To get "derailed_cuke"? + you could either clone the repo or download compressed project in following ways ~
Clone Repository:
#git clone git://github.com/abhishekkr/abk-labs.cucumber.git


[] Pre-requisites for "derailed_cuke"?
+ Ruby, RubyGems & Bundler Gem installed


[] How to use "derailed_cuke"?
+ The downloaded project would have a directory "abk-labs.cucumber" with a directory "derailed_cuke" inside it.
~~~~~~~~~~
Step#1 Now all you need to do is open a console, change current working directory to "derailed_cukes".|
Step#2 Run "#bundle install" to install all required gems.
|

Step#3 If your ruby binary file is accessible by any name other than 'ruby' {i.e. say you are jruby and thus access it using 'jruby'}; then edit the file "Fcuke.rb" and replace the value of variable "RUBY_BIN" in line number 2 with the name you access your Ruby Binary.
|
Step#4 
Now simple execute "
Fcuke.rb" and by default it will check for two (already present for testing) features checking Google.com and Twitter.com
|
Step#5 
To add custom web-application behavioral tests ~ user will need to write the custom Cucumber Features and respective Step Definitions {as in general scenario for using Cucumber}. For reference present feature and step definitions can be seen & used.

~~~~~~~~~~

[] Where to learn cucumber?
+ http://wiki.github.com/cucumber/cucumber/tutorials-and-related-blog-posts
In current release of "derailed_cuke", user need to know writing Cuke Features and Step Definitions.


………………………………………………………
[] Planned Goals for the Project involves
+ auto-generation of basic tests by analysis of application,
 then major task left would be to add uncovered custom tests
 and tweak the generated tests (if required).


………………………………………………………

Wednesday, June 22, 2011

Host Your Site on Google AppEngine in 7 Easy Steps

Project/Example Site: http://gae-flat-web.appspot.com



Host Your Site on Google AppEngine in 7 Easy Steps:
  1.  Register any $App at Google ApEngine using your Gmail Account
    {as if $App is you Application Name giving you url like $App.appspot.com}

  2.  Download the Python Script 'flat.py' provided on this site or from repo
  3.  Execute #python flat.py $App
  4.  It will created required structure in a dir $App
  5.  Copy all your static site to $App/flat_web/*
  6.  Download "Google AppEngine Python SDK"
  7.  Update this $App using Google AppEngine SDK as
        #python appcfg.py update $Path_to_App

[[ Your own Static Content Website served by Google AppEngine ]]

 It's GitHub Repository: https://github.com/abhishekkr/gae-flat-web

Sunday, September 26, 2010

Git on Windows [ Beginners HowTo ] - Part 1

This is Part#1 'HowTo' beginners guide for using Git, one of the best open-source SCM (Source Code Management) technology devised by Linus Torvalds to manage Linux's source code contribution from the phenomenal linux community.
location for 'msysgit': http://code.google.com/p/msysgit/

Topics covered in this video tutorial:

  1. downloading 'msysgit', windows Git implementation for Git
  2. installing 'msysgit' properly to have a GUI option in context menu of directories
  3. using GUI: creating a new Project with Git Repository
  4. using GUI: making changes to repository and committing them
  5. using GUIcloning a local and a remote repository

@Youtube: http://www.youtube.com/watch?v=Npd1UA4exCc

@Vimeo: