26 October 2007

Struts- MVC Architecture Contd...............

This figure depicts an M-V-C Architecture.
M-Model
V-View
C-Controller

Model- That part of application which deals with database creation, insertion and retrieval of data is know as Model. Programming of database can be done through JDBC, hibernate and other database languages.


View - These are the dynamic or static web pages which can be created using JSP , JSF etc. These are similar to HTML tags in many ways only additional thing which they enable is the support for JAVA which makes them far more powerful than HTML tags.

Controller-This is that part of your application which process each request sent by web browser and decides upon which next page should be displayed.

Form Bean- These are those classes which store values of parameters filled in a given form. Each JSP page has a form bean where the value of all parameters or fields is set or reset.

Now i will try to explain the flow of control from the above picture step by step

  1. Web browser sends a request to server.
  2. Servelet take this request and first stores all the parameter(Fields) value which where filled in the form to the corresponding Form bean of the page.
  3. Then Servlet goes to Action class which is the controller of your application. This class helps determining the next JSP page on the basics of Field or parameter values which it retrieve from bean.
  4. Action class interacts with Business Logic for retrieving desired data from database.
  5. Then data is sent to the next JSP page selected by the Action Class.
  6. JSP is then sent to Web Browser.



Sphere: Related Content

Struts- MVC Architecture

Its my first time on this blog that i am going to try to take up some technology. These days i am busy with final year seminar which is Struts an MVC architecture, so now i have decided to take up this topic in my blog.

Struts

Apache Struts is an open-source framework that is used for developing Java web application.Originally developed by the programmer and author Craig R. McClanahan this was later taken over by the Apache Software Foundation in 2002. Struts have provided an excellent framework for developing application easily by organizing JSP and Servlet basically based on HTML formats and Java code.

Why do we need Struts?

Java technologies give developers a serious boost when creating and maintaining applications to meet the demands of today's public Web sites and enterprise intranets. Struts combines Java Servlets, Java ServerPages, custom tags, and message resources into a unified framework.

How does Struts work?

Struts combines Java Servlets, Java ServerPages.

  • Java Servlets are designed to handle requests made by Web browsers.
  • Java ServerPages are designed to create dynamic Web pages.
Struts uses a special Servlet to route requests from Web browsers to the appropriate ServerPage.

Why is it called Struts?

It's a reference to struts in the architectural sense, a reminder of the nearly invisible pieces that hold up buildings, houses, and bridges.




Sphere: Related Content

18 October 2007

Apple announces SDK for iPhone

It finally happened. Steve Jobs announced an iPhone SDK. The plan is to release it in February, and the suggestion is that apps will need to be digitally signed . Here's hoping that developing for the iPhone/Touch will be cheap (or free) enough to allow the folks who have been writing apps to continue doing so. Says Jobs: 'It will take until February to release an SDK because we're trying to do two diametrically opposed things at once--provide an advanced and open platform to developers while at the same time protect iPhone users from viruses, malware, privacy attacks, etc. This is no easy task.'

My prediction is that it'll be a lot like some Java handhelds. There will be a key repository. It will come with the public key of Apple and, for iPhones, for the carrier from which you currently get service. Developers will be issued a key pair, one to go onto the device they use for development, and one to sign the apps they're developing, but installing the pubic keys onto arbitrary devices will be non-trivial.

My prediction based on that is, anyone who cares about running a wide variety of apps will register as a developer and get a key pair, and freeware apps will have to be open source, because in order to get them signed correctly, people will have to compile them from source so that they're properly signed for their own devices.

With the introduction of the SDK, I think we're going to see a batch of really nice 3rd party apps. The current ones are extremely good for what resources are available, but I think everyone would agree there is room for much improvement.

Most past attempts as application/driver signing have failed because it hasn't been about signing but rather about making $$$. And signing has cost book u bucks for being signed. This is the aspect of signing that's bad. It will be fine for app signing as long as it's free to do so or a negligible (ie: $5-$10) processing fee. But if it's $500 or $1,500 to have your app signed. Then it will fail...

The situation will be the same as with the iTunes SDK: to get the SDK you'll have to sign an agreement that gives Apple veto power over your application. Every time people flamed me.Anything they don't like, gone. They say its to protect users from spyware and other forms of malware but it'll be used to eliminate anything they don't like. Instead you'll get crippled functionality, like music sharing with ridiculous limits on the number of people/playbacks per day.

Rest lets wait and watch its impact on technology front.................................................................







Sphere: Related Content

13 October 2007

Sony Ericsson P1i

Sony Ericsson announced the latest in its smartphone line up - the Sony Ericsson P1i. The P1i is a touchscreen smartphone with a 3.2 megapixel camera, Bluetooth 2.0, tri-band GSM (900/1800/1900), and WiFi connectivity.


Beneath the 2.6 inch screen is a QWERTY keyboard . Rather than a key per letter as is the norm with thumb keyboards, the P1i innovates the design with each key serves two letters, with the letter entered dictated by the side of the key you press. This allows the overall size of the keyboard to be slimmed down, while maintaining good sized keys and thus giving a more pocketable, narrower phone.

Smaller size

The familiar Sony Ericsson hand writing recognition input option is present for those who do not want to use the keyboard. Both keyboard and pen input support the excellent predictive input software which can speed up input by about 20%.

The main consequence of the smaller form factor is a significant reduction in the overall size of the P1i at 106 x 55 x 17 mm and 124g, a lot features have been packed into a small space. Most of the size reduction has been achieved by making the phone much slimmer.


The P1i, P990 and W950i compared. The reduced size of the P1i compared to the P990 is clearly evident here.

Upgraded Ram

The most welcome upgrade for the P1i is the addition of an extra 64 MB of RAM. The earlier UIQ 3 devices each had 64 MB of RAM, the P1i has 128 MB. The immediate consequence of this is to ease multi-tasking - fewer applications will shut down in the background due to low memory (RAM). Larger memory makes up to 15 applications running at the same time on the P1i possible and switching between applications will be faster. Perhaps even more welcome will be an end to the 'out of memory' errors that occurred when running RAM hungry applications such as the Opera browser. The extra RAM also, seems to have speeded up general phone operation, moving through menus and application functions is faster, with many functions being instantaneous.

Auto Contact Addition

The P1i's 3.2 megapixel auto focus camera produces excellent results, comparable to any other smartphone on the market today. The camera is good enough to replace basic digital cameras, even the performance in low light conditions is fairly reasonable thanks to the dual LED flash. As with other LED-based flashes, results do start to deteriorate when the subject is more than 3 or 4 metres away, but the P1i produces better results than many camera phones in this area. Video capabilities are also good and should be sufficient for most basic tasks and 'life recording'. The camera is used in one of the most innovative applications, the business card scanner .


The P1i has a dedicated camera capture button on its right hand side.

RSS feeds

Use your phone to view up-to-the-minute news and other content from selected websites and blogs. Just subscribe to the feed and let it come to you.

Music recognition
What’s that sound? Just record a few seconds of music and TrackID™ (powered by Gracenote Mobile MusicID) returns the song name, artist and album to your phone within seconds.








Sphere: Related Content