Sencha Cmd featues and Usage

Sencha Cmd is an excellent cross platform command line tool which can automate many tasks around the life cycle of our Sencha ExtJS and Sencha Touch framework based appliacations from generating a new project to deploying it for production.

Sencha Cmd tool features:
This tool provides us lots of useful features like:
Code generation: Sencha Cmd can generate entire applications and also can extend those applications with the ExtJS MVC components.
JS compiler: Provides a framework aware JavaScript compiler which knows the semantics of Sencha frameworks and can also produce minimal footprint builds of the application source.
Web server: Provides a lightweight web server which can serve files from the application directory.
Packaging: Provides native packaging to convert Sencha Touch based applications in to a mobile application that has device level functionality and can be distributed in App stores.
Management system: Provides distributed package management system to easily integrate the packages created by others or within Sencha package repository.
Build Scripts: Build script for the applications and packages with “before” and “after” extension so that we can easilty customize the build process.
Tuning: Provides powerful code selection tools that we can tune our application for the final build like what should be included, determining common codes among the pages and also partition the shared coded into packages.
Workspace: Helps in sharing frameworks, packages and code between the applications.
Image capture: Can convert the CSS3 features into sprites for old browsers.
Flexible configuration: Easily configurable command options.
Logging: Useful logging system which helps us understanding and troubleshooting many poroblems.
Third party softwares: Sencha Cmd tool includes a compatible version of Compass, Sass, and Apache Ant within it.
Code generation hooks: Page specific or can be shared by all the pages available in the workspace. Like we may need to check the coding conventions or the guidelines as the new classes are generated.

Command line reference
sencha ant
This command invokes the embedded version of Apache Ant with helpful properties back to the Sencha Cmd.

Command options:
• –debug, -d – Enables the debug level messages for Ant.
• –file, -f – Ant file to execute. The default file is build.xml.
• –props, -p – Properties for the Ant script as name value pairs like:
name=value,…
• –target, -t – The target(s) to be executed through the Ant script.
• –verbose, -v – Enables verbose level messaging for Ant.

Command syntax:
sencha ant [options] targets…
In the above command the targets represents the Ant script to execute

There are multiple command .Check on http://docs.sencha.com/extjs/4.2.2/#!/guide/command

Happy learning.

What is static nested class and usage in Java

Question -What is static nested class and usage in Java

Solutions– Many developers are confused and telling static nested class as static inner class.But in java, there is no static inner class. 😮

Ok.First we understand ,

what is inner class – inner class or nested class is a class declared entirely within the body of another class or interface.An instance of a normal or top-level class can exist on its own. By contrast, an instance of an inner class cannot be instantiated without being bound to a top-level class.

class OuterClass {

  class InnerClass {  }

}

Types of nested classes in Java

Member class – They are declared outside a function (hence a “member”) and not declared “static”.
Local class
Anonymous class

Nested or inner class is a member of its enclosing class.
Non-static nested classes (inner classes) have access to other members of the enclosing class, even if they are declared private. Static nested classes do not have access to other members of the enclosing class.A static nested class interacts with the instance members of its outer class (and other classes) just like any other top-level class. In effect, a static nested class is behaviorally a top-level class that has been nested in another top-level class for packaging convenience.

Why we use– if a class does’nt depend on anything other than his outer class then we will create static nested class.for example – we have nThere is no need for LinkedList.Entry to be top-level class as it is only used by LinkedList (there are some other interfaces that also have static nested classes named Entry, such as Map.Entry – same concept). And since it does not need access to LinkedList’s members, it makes sense for it to be static – it’s a much cleaner approach.

Happy learning with Vinay in techartifact…