Archive

Archive for November, 2009

Why Properties matter : Uniform Access Principle

November 28th, 2009

Learning a new language has various side-effects. Old habits are questioned, good practices are reinforced while bad habits come to light. By re-learning programming principles in a new syntax, in that strange new world (IDE, Syntax, etc..) you learn something new about your favorite languages – and often yourself.

I started off in C++ moved to Java then C# and most recently have begun working w/ Scala. In the book, Programming Scala by Dean Wampler & Alex Payne, the Uniform Access Principle was described & named.

So what is all the hubbub about Uniform Access Principle?

Clients read and write field values as if they are publicly accessible, even though in some case they are actually calling methods

In short, from the outside, a method or field is indistinguishable.

Why is the Uniform Access Principle important?

Classes can interchange methods and fields without affecting the classes that use them.

 

Language support of UAP?

Sadly, few languages (that I know) support UAP fully.

JAVA

Java does not support UAP, either a class has a field or bean properties. (getter/setter).

public class Employee{

    private String m_name;

    public String getName() {
      return m_name;
    }

    public void setName(String name) {
      return m_name;
    }

}

C#

C# does not fully support UAP, but fields & properties are partially indistinguishable. Here are the short comings:
  • interfaces can not contain fields, only properties.  [ propName {get;set;}  vs fieldname; ]
  • fields can be passed by ref or out but not properties (see example project)

 

    class Program
    {
        static void Main(string[] args)
        {
            var e = new Employee();
            e.Name = "Alan Huffman";

            PrintRef(ref e.Name);

            var e2 = new EmployeeProp();
            e2.Name = "John Dobson";

            // COMPILATION ERROR
            // can not pass a property by reference
            PrintRef(ref e2.Name); // *** Compilation error

                     image
        }

        public static void PrintRef(ref String str){
            Console.WriteLine(str);
        }
    }

     

    public interface IEmployee
    {
        String Name;

          image

        // if we change the field into a property, we get an error on Employee class below

        String Name {get;set;}
    }

    public class Employee : IEmployee

    // if the interface defines a property and we try to implement w/ a field

    image
    {

        public String Name;

    }

    public class EmployeeProp : IEmployee
    {
        public string Name { get; set; }
    }

     

     

    SCALA

    SCALA does support UAP, essentially providing abstraction at a language / syntactic level.

Though there is no scala analogous type to C# or Java’s interfaces, traits are close. See here for more http://www.codecommit.com/blog/scala/scala-for-java-refugees-part-5

    Here you can see the treatment of the trait IEmployee’s Name property.

     

    trait IEmployee {
      protected var s : String = ""
      def Name : String  = s
      def Name_=(news : String) = s = news
    }

    class E extends IEmployee{
    }

    class F extends IEmployee{
      private var x = s
      override def Name = x
      override def Name_= (news : String) = { s = news; x = news; }
    }

    The property can be accessed via a DOT operator, e.g.

    var f = new F

    var e = new E

    f.Name = “foo”

    e.Name = “foo”

    Alternatively IEmployee could have been written this way:

    trait IEmployee {
      var Name = ""
    }

    class E extends IEmployee{
    }

     

    // However, this no longer compiles! [ I think this has larger implications (see below) ]

    class F extends IEmployee{
      private var x = ""
      override def Name = x
      override def Name_= (news : String) =  x = news;
    }

    image

     

    Omitting the override, results in an alternate error:

    class F extends IEmployee{
      private var x = ""
      def Name = x
      def Name_= (news : String) =  x = news;

    }

    image

     

     

    Because the choice of using a var Name = “” [ field ] or a property def Name = … & def Name_= (news:String) = … [property] has affects what can be done in mixins, the UAP only applies access to but not overriding of a [field] / [property]

    In this case, the C# & Scala are similar, except that traits can have fields while interfaces can not.

    Prefer flexibility

    I am lead to believe that I should prefer:

> Using traits in method signatures: The corollary to “code to interfaces not concrete classes”  in Scala becomes “code to traits not concrete classes

> When defining traits, there is more flexibility in defining properties as opposed to fields.

In the wild, fields are preferred (but traits in signatures does hold)

That said, I have been told that fields are more often defined, "var Name = …” and can be changed later on, as needed, assuming you have access to the code.

alan.huffman C#, JVM Languages, Scala , , , , ,

Sugar CRM :

November 1st, 2009

image

SugarCRM helps manage:

  • Generating and qualifying leads
  • Selling process
  • Customer support
  • Resolving reported product or service issues
  •   

    Ranking CRM Solutions:

    According to : http://www.crmsoftware360.com/

Top 5 On-Demand CRM

  • Aplicor
  • Entellium
  • Microsoft Live CRM
  • RightNow
  • Salesforce.com

Top 5 On Premise CRM

  • Microsoft CRM
  • Consona Onyx
  • CDC Pivotal
  • SAP
  • Oracle’s Siebel

Top 5 Open Source CRM

  • SugarCRM (current open source leader)
  • Anteil
  • Compiere
  • Daffodil
  • Vtiger
  •   

    image

    While there truly is no open source CRM product designed or well suited for the enterprise market, SugarCRM makes the greatest strides and comes the closest.

      SugarCRM at a glance

      • The current open source leader
      • Good venture financing
      • International expansion underway
      • Microsoft friendly solution
      • On-premise or hosted delivery

       

        Prediction #9

        Open Source CRM and ERP Fail to Gain Traction (Again)
        2008 was to be the year that open source CRM and ERP software applications evolved from an interesting proposition to a viable business option. It did not happen. The back office and ERP open source community failed to show growth, demonstrate customers successes and actually moved backswords in many aspects. The CRM software open source movement saw similar declines from the recognized players, with the possible exception of SugarCRM. SugarCRM enjoys good media coverage, a vibrant open source community (60,000 members strong) and proclaims growth and an IPO in 2009, however, the open source CRM company is rumored to be losing well over $1 million per month and living off its continual stream of venture capital infusions (now totaling approximately $50 million). Additionally, despite the company’s aggressive efforts to acquire enterprise level customers, demonstrated successes and documented case studies are absent. Expect open source CRM and ERP projects to show slow but steady penetration in the small business market, however, continue to be passed over by the mid- and -enterprise markets.

      Paul Greenberg, president of The 56 Group LLC

      http://www.crmforecast.com/opensourcecrm.htm

      The open source value proposition suggests that free software is good and when a community of technical participants can read, modify and redistribute software source code, the community and the software evolve. While this value proposition is valid with some types of software, such as (Linux) operating systems and (Apache) web servers, opensource has not proven successful in the front office CRM or back office ERP (Enterprise Resource Planning) business applications market.

       

      Core Features

      Sales Management

      • Lead, Contact, and Opportunity Management to share info and pursue new business.
      • Account management to manage all customer interactions in a single location.

      Marketing Automation

      • Lead management for tracking and cultivating new leads.
      • Email marketing for touching prospects and customers with relevant offers.
      • Campaign management for tracking campaigns across multiple channels.
      • Campaign reporting to analyze the effectiveness of marketing activities

      Collaboration

      • Activity management for Emails, tasks, calls, and meetings
      • Content syndication to consolidate third-party information sources.

      News Service

      • The RSS news feeds module lets you select and manage your favorite news feeds, and display them on your My RSS News Feeds screen.

      Administration

      • Quickly edit user settings, views and layouts in a single location.
      • Customize the application with Sugar Studio so that Sugar meets the exact needs of your company.

      Technology Stack: LAMP or WIMP

      LAMP (Linux, Apache, MySQL, PHP) or WIMP (Windows, IIS, MySQL, PHP)

      • PHP development environment
      • The MySQL relational database
      • The Apache or IIS web servers
      • The Linux or Windows Server operating systems.
        • Editions / Pricing

           

          Link: http://www.sugarcrm.com/crm/products/editions.html

          Sugar Community Edition

          Sugar Professional

          Sugar Enterprise

          Free

          $360/user/yr

          $600/user/yr

          GPLv3

          5 users min

          5 users min

           

          Licensing:

          GPLv3 – See excerpt below [link] [ from Stallman on GPLv3 : “free speech”, not  “free beer”. ] 

          While open source licenses by definition are not very restrictive, the GPL is among the most restrictive of open source licenses. The GPL is used for, among other things, the Linux kernel and most software released by the GNU project.

        Can money be made with SugarCRM? [yes]

        Add-on modules can be sold. Sugar CRM even has a marketplace for that: Sugar Exchange.

        Apps can be built to “Share or Sell”.

        image

        image

         

        New in 5.2

        • Cloud Connector Framework to pull outside data into your system
        • Sugar Feeds Framework leveraging logic hooks
        • Module Level Administration to allow better granularity of the management of your system without having to give users full admin access

        Documentation:

        https://www.sugarcrm.com/crm/support/documentation

        [5.2 Online Development Guide]

        [5.2 ER Diagram] 29 Tables w/ diagrams (full: below) and logical “parts”. There are a variety of ways to access data in the DB (SOAP, REST|JSON/XML)…

        image

        Logical ER Parts like Activities

        image

        Custom Modules

        • A basic how to build Modules: [ LINK ]
        • Access Sugar Data using JSON, REST… [ LINK ]
        • Access Sugar Data using SOAP: [ LINK ]
        • Custom Modules Blog Post: [ LINK ]
        • SugarCRM has come a long way from it’s early days as a basic CRM application. It is now gradually becoming more of a platform than an application. … all a module does is describe the properties and supporting UI elements required to support a certain type of data object. SugarCRM supports many objects (modules) out of the box - accounts, leads, projects,cases, calls etc. If you want to add support to a new type of object, you need to to create a new module to represent that object.

          Books

          After a cursory search  on Amazon, there were few recent books of interest. There is one book that is soon to be published by aPress.

        The Definitive Guide to SugarCRM: Better Business Applications

        By: John Mertic : ISBN13: 978-1-4302-2439-6  : ISBN10: 1-4302-2439-8 
        300 pp. Will Publish Nov 2009 Print Book Price: $59.99 eBook Price: $41.99

         

        SugarCRM is a leading open source Customer Relations Management tool and development platform with nearly 5.5 million downloads, nearly 17,000 developers, and lots more users.

        The Definitive Guide to SugarCRM is the first official SugarCRM book available to developers and users. This definitive book begins by talking about the SugarCRM platform components, namely MVC, Studio, Module Builder, authentication, and themes.

        Next, you see how to customize the modules SugarCRM comes with out of the box in an upgrade-safe manner. The text then presents an example application that a typical business might use and shows how to build it using SugarCRM, using both existing functionality as well as newly added functionality.

        What you’ll learn
        • Understand how the SugarCRM platform works
        • Customize the modules that come with SugarCRM
        • Build new modules and functionality into SugarCRM
        • Explore MVC architecture, users/authentication, built-in modules, and other platform features
        • Use SugarCRM Studio for customizations, logic hooks, and overriding existing code
        • Build on top of SugarCRM using Module Builder, custom modules, and existing/custom modules mashups
        • Design a complete application

        Various technical details

        • Templating : (recommendation) SMARTY for templating. http://www.smarty.net/
        • JavaScript QuickSearch: Sugar 5.1 uses QuickSearch based around ExtJS
        • Module (add-on) Level Administration allows configuration of value add features
        • Scheduler will execute functions at predefined periods
        • Logging is supported
        • Web Services are supported (SOAP [WSDL]) , REST/JSON|XML
        • Cloud Connectors Framework provides access to SOAP/REST (e.g. Cloud) services

        Conclusion

        OpenSource CRM is a small percentage of the over all CRM market. There is little optimism that Open Source CRM will make significant strides in the Enterprise. That being said, SugarCRM is the Open Source CRM leader and has made great strides to ease customization (mainly through Modules and Dashlets). The application embraces open standards and should make developing “for profit” add-ons for specific industries like Healthcare possible.

        Having said that, a company should not solely rely on a Sugar CRM install base, especially in the Enterprise. This is not a platform to be married to as “the” CRM solution / application framework, rather a company would be smart to provide plug-ins for SugarCRM but also target other CRM solutions / frameworks.

        alan.huffman CRM , ,