Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Showing posts with label Adobe. Show all posts
Showing posts with label Adobe. Show all posts

Thursday, February 5, 2009

Flex 3 Need web service or a servlet will do?

Flex 3 talks so heavily about the using web services to get data over internet that sometimes people who dont have real complex requirements are stumped by this. 

Creating SOAP web services is pretty tedious sepcially for beginners. So, a wise question to ask will be if really a web service is required to retrieve data over internet or a very simple thing like a servlet will do that job?

So some one will need a web service to consume in a Flex app when the business logic has to made available to the third parties too. Other scenarios are like a web service already exists for the functionality.

However, if the data has to consumed for some small apps and not required to be made available to third parties then a simple servlet can do a job which can return the desired XML output in the respone.

Just as an example you can write something like:


public class MyServlet extends HttpServlet {
   
    public MyServlet () {
    }
    
    public void doGet(HttpServletRequest req, HttpServletResponse resp) 
                throws ServletException, IOException {        
       try{
                      
            resp.setContentType("text/xml; charset=UTF-8");
            PrintWriter out = resp.getWriter();
            out.println("");  
            out.print("30");
            out.println("");  
            out.close();
        }catch(Exception e){
        System.out.println("DataException in startFetching ::" + e.getMessage());
          e.printStackTrace();;  
        } 
       
       return;
    }
}

And in your Flex App you would specifying the url that you will be use to deploy the servlet.


Friday, August 22, 2008

Deciding to create components in MXML or ActionScript

"picked up from Adobe Developer guide"

One of the first decisions that you must make when creating custom components is deciding whether to write them in MXML or in ActionScript. Ultimately, it is the requirements of your application that determine how you develop your custom component.

Some basic guidelines include the following:

  • MXML components and ActionScript components both define new ActionScript classes.
  • Almost anything that you can do in a custom ActionScript custom component, you can also do in a custom MXML component. However, for simple components, such as components that modify the behavior of an existing component or add a basic feature to an existing component, it is simpler and faster to create them in MXML.
  • When your new component is a composite component that contains other components, and you can express the positions and sizes of those other components using one of the Flex layout containers, you should use MXML to define your component.
  • To modify the behavior of the component, such as the way a container lays out its children, use ActionScript.
  • To create a visual component by creating a subclass from UIComponent, use ActionScript.
  • To create a nonvisual component, such as a formatter, validator, or effect, use ActionScript.
  • To add logging support to your control, use ActionScript.

Tuesday, July 29, 2008

Using SVN with Flex 3

Well there is a plugin available for using with Flex 3 (only for this version of flex).. to install follow:

Start by opening Help -> Software Updates -> Find and Install. This will open up a dialogue that will let you select to either update existing features or Search for new features to install.

Click the "New Remote Site" button and set Name to "Subclipse". Enter the URL http://subclipse.tigris.org/update_1.2.x and press ok.

If you just go with the default checked off, you'll also need to install some extra support libraries called Buckminister and Mylyn. but it is not req for normal use. so expand the subeclipse and uncheck integrational option.

Make sure that only "Subclipse Plugin" is checked and click "Next". Accept the terms, click "Next" and then "Finish" to install. This will start the download of the plugin. You'll need to verify the features installed and restart. That's it.


On the other side it requires a svn repository.. that can be created on a server on free webs like cvsdude, assembla etc...

in Flex3 go to windows --perspetive -- other and choose svn repository. it will open a new side bar. Right click in it and provide the path of your svn repository. now the project which is required to be added to svn just right click and choose team --share. (it will ask to choose svn or cvs in a new dialog, choose svn).

Tuesday, July 1, 2008

Spry

The Spry framework for Ajax is a JavaScript library that provides easy-to-use yet powerful Ajax functionality. It is designed to take the complexity out of Ajax and allow designers to easily create Web 2.0 pages.

This is another beautiful development at Adobe labs... check it here.

Along with Ajax wrapping up they have come up with a number of widgets and other nice UI layouts which can be integrated with other Ajax based frameworks like DOJO.. For example check this Auto suggest widget here. It provides a variety of ways to get the data to auto suggest like from static array, a local xml file or dynamically using a Ajax request from server..

You can find more samples here

follow up the home page for more info...