Many MVP's for the same page? - gwt

I have started experimenting with GWT 2.8 and MVP pattern.
I want to make a simple browser app that sends and fetches data from client to server, that has only one page.
Should I use only one MVP that handles everything in the page?
Or can I use many MVP's that implement different parts of the page?
For example, one MVP would handle the adding updating entities part of the page. The other would handle the presentation of the entities. Another one something else.
Is it a good practise to use many MVPs for the same page?
Thank you very much in advance.

I would suggest using a mvp pattern even in small cases. It will make it much easier to expand a one pager later and to maintain everything.
But, I would not use Activities & Places, Domino-MVP and Nalu offer much better implementation, easier to understand and much more light-weighted.
Both offer artifact creators which make the start very easy.
Use the Gitter room to ask questions. (Domino room, Nalu room)

Related

How to implement a chat system in my web application with Vue and Java EE?

I have a Web Application based on Vue.js, REST(JSON) and Java EE with Payara Server.
Now i want to add a chat. There should be different fixed chat rooms (global, groups) and there should also be the possibility for private user-to-user chats.
I've been looking for a while now and have come across various Vue Chat projects that use 3rd party services e.g. socket.io, PubNub, CometChat. I don't want to outsource any functions in this way. In addition, it probably does not make sense to use finished components, since I have so far not found anything that can meet the above specifications and I would have to modify the component accordingly.
So I think I can't avoid building something new for myself, which is not a problem. However, I don't want to reinvent the wheel and I'm unfortunately not familiar with the best practices of building chat applications.
Roughly off the hook, I would create a database table that is used to store the messages. The messages are delivered and picked up via my REST interface, in whatever way.
Is this direction correct? Can i make it like this? It kind of feels ... dull. I have seen a lot of finished chat servers, do i really need something like this, or can I implement this with my Payara server without major complications?
Unfortunately I could not find any suitable examples. I would be very grateful for a short advice or suggestions.
the best advice I can give you is to use a communication protocol which grants real time data. I mean, something like websockets or socket.io, which is a pretty good option.
Besides, if you want to develop a chat app, the data will be bidirectional, this means that it will travel from server to client and viceversa. I hope this could help you. Here
you have an example of a pretty basic chat app using socket.io.
I hope this could help you, regards

Model-View-Presenter with Google Web Toolkit (GWT)

I am thinking about developing a new application using web toolkit. I decided that the best option is going to be to use the Model-View-Presenter Design Pattern. After doing plenty of research, I found two different ways of implementing the skeleton code. (I am still trying to learn MVP and how to best utilize the disjunction between the model and the view)
Here are the two links discussing GWT MVP
https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces
https://developers.google.com/web-toolkit/articles/mvp-architecture
I read through and understand all the information in the second link, how you associate presenters with views, and how you have your custom events and such. I really like this because this means that several developers will be able to work on the project I have in mind.
However, the first link, also points out some interesting stuff, mostly using XML and #UiBinder and other things. I feel that those will not be necessary for this particular application but I want to make sure I have not overlooked anything.
Basically - How good of a programming practice is the style the style in the second link (the one with presenters for each view)
Thank you
You should be not be comparing MVPActivitiesAndPlaces and MVP . If browser history management is not your concern use only MVP.
Activities And Places are not mandatory for MVP. They only allow you clean browser history management which integrates nicely with MVP architecture.
UiBinder is not mandatory for MVP. They can be used with MVP.
The MVP design paradigm mostly is driven with Unit testing as main driver and to keep out slow running GWTTestCase out as much as possible.
At the heart of this pattern is the separation of functionality into
components that logically make sense, but in the case of GWT there is
a clear focus on making the view as simple as possible in order to
minimize our reliance on GWTTestCase and reduce the overall time spent
running tests.

Realizing the design from a design professional in code

I typically work on web apps that will only be used by a small group of well-controlled people, but now find that I'm writing something that has the potential to be used by a very large population. This means that the design and "look" will be very important to the success.
While I can certainly code up something functional, it ain't gonna look pretty, so I know that I'll need to get an outside designer to make things look good. Never having worked that way before I had a few questions about the mechanics of how this happens and how to try to make things easier.
We do Java, so when building a rich interface, we use GWT. I know that when working with designers, they typically provide images of what the interface should look like without any type of "useable" output. My question is how best to bridge that gap between a simple drawing of an interface to a fully functional realized one.
Any thoughts are appreciated.
Well, "it depends", as always.
Nowadays, I don't think you can work wit someone who simply provides PhotoShop mockups. At least not at your level. Mockups are simply too static, and translating those mockups to actual pages that actually work with different browsers properly is a skill set all its own.
So, you need someone beyond simply a designer, especially if you are planning any javascript wizardry, animations, or other dynamic elements that don't capture at all well on a static image.
What you really want is an "operational" mockup. Static HTML files that look and behave as best as can be done to what the UI designer wants to do, including transitions, work flow, etc. This artifact can be run through all of the stake holders as a live mockup, letting folks "Feel" the site.
Once you have these HTML files, you can then do your part of backfilling these pages with actual server side content. Obviously you can start early working on models and working with the designers so as to have services ready to support the site functionality, but you shouldn't be committing any real time in to actual pages for the site.
As for interacting with the designers, I talk more about that over here: How can I make my JSP project easier for a designer to work with
I worked on a project very much like this. We had "comps" which were pictures of what the interface would look like. We identified common objects and build modules. Then built pages (this was for a web app) from modules plus any elements that were unique to that "comp".
A couple things to keep in mind that will make life much easier: use the comps/drawings as more of a recommendation rather than set in stone design. Try to identify common pieces early on and reuse code.
Also, designers aren't user experience gods. They often have a good idea of how things should work, but if you are close to your product and have a lot of product knowledge, don't be afraid to tweak the design as you and your group see fit. One thing that designers typically lack is product knowledge. They know a lot about general user experience and how a site should work, but they often won't know the in's and out's of your use cases and products.
If you are working with GWT, you should look for designers who are expert in CSS. Apart from, may be, the main layout of the website, all the application components like form fields, dialogs, tabs and grids etc. will need to be styled using CSS.
If the designers are not experienced in working with GWT, share the GWT's documentation about styling with them. It's a good idea to read these yourself as well. Specifically explore the GWT's theme-ing system.
Also try to make use of UiBinder as much as possible. This would allow you to stay as close to traditional HTML based design while still enjoying the GWT high level object oriented interfaces (both widgets and DOM).
Optionally you might want to tell the designers that GWT image bundles will automatically do "CSS Sprites" so they don't need to worry about page load performance issues related to images.

Designing a iPhone application

I am into designing a new iPhone application. My application is will contain almost all iPhone SDK concepts including core data, server integration, location services. Is there any design decisions I should keep in mind?
My plan was to go by designing a controller class for each iPhone app screen and also any utility classes to be used. Any guidance will be really appreciated.
I forget who said this first, but it goes like this: The first project you do in any new technology will probably be very bad!
This is similar to these sage words from Fred Brooks - "Plan to throw one away; you will anyway"
So the best way is to wade right in, get dirty, light up the dark corners and learn what works for you. Then you'll most likely have some very specific questions based on your experiences!
This is a tough subject to talk about generally. Design approaches that work for some will fail for others.
It would probably help to know more about what you are trying to do. For a counter-example, I'm working on a game. I create an OpenGL context and from that moment on I'm managing assets like shaders, textures, mesh data, sounds,... . The way I've designed my project will pretty much be useless to you.
However the best advice that I can come up is to really figure out what you are trying to do. Create mockups of your GUI and document workflows. Do sketches of GUIs. Become an expert in the domain in which you want your application to work. Develop a deep understanding of what you are trying to do.
Once you have the GUI figured out, start working on the other end of the Model-View-Controller approach - figure out what data you need in order to provide the GUI that you've designed. Not all data structures are equal. What's the best data design for the domain you're working on?
Once you have the view and model figured out you need to glue everything together with controllers. There's lots of trick and traps here. Do you use threading to prevent the GUI from blocking? Do you make direct calls to objects or do you decouple and use notifications?
But this is the public appearance of your application. You might want to track usage data - consider what you wish to track and append that to your design. Errors happen, so think how to approach them.
However, it's hard to be more detailed without more details than what you've provided. Every application has it's own quirks and gotchas. It's nearly impossible to talk about this in a general sense.

Roll my own or use existing CMS (Drupal perhaps?)

I need to create a internal website and can't figure out if we should be writing our own, or using an existing framework.
Most of the website will essentially be a front end to a database. We need to have a number of people enter data into forms. We then want to be able to show different views of all this data -- including running small queries (e.g. how many resources do we have with attribute 'X'). As is usually the case with this, we will want to tweak the UI on a regular basis.
There actual data design is not a simple 1:1 mapping of resource to entry. For example, we might track several attributes for one item as the "base set of data" for that item. Then we could have several additional sets of data.
Imagine a recipe application. You might have a recipse for a starter. This could then be referenced by several other recipes that need that same information.
I feel like this is best suited for a general framework (Ruby on Rails, Django, etc), but I wonder if it might not be good for a "traditional" CMS platform like Drupal? I specifically mention Drupal since the people that would develop this have the most knowledge using php and MySql.
I usually lean towards wanting to use an existing platform, but am interested in other people's thoughts. To give you an idea of scope, I would imagine if we wrote this from scratch we are probably talking about 3-5 weeks of development.
Would you recommend writing our own, or using an existing framework? If you would suggest using something that exists what would you recommend?
Would you consider this to be best suited for a straight framework or a straight CMS?
Thanks!
It's possible that Drupal will be a good solution for you, though you'll probably need a few key additional modules like the "Content Creation Kit" (CCK) and "Views".
Unlike other web CMS systems (WordPress, Exponent, phpNuke), Drupal treats your entries as a "pool" of content, from which you pull various subsets for different areas of your site.
There is a lot of documentation for Drupal (almost too much), the biggest problem is finding the piece that's relevant to what you're trying to achieve. Diving on to one of the interactive IRC channels can be a good idea, as the community is quite helpful and is almost always willing to give you a pointer in the right direction.
The power, flexiblity and capability of Drupal is both its biggest strength and weakness - I know it took me a bit of effort to get my head around key concepts, and I'm far from being a Drupal Expert.
One last comment: Having written my own CMS from scratch, which I abandoned in favour of Drupal, I'd suggest your 3-5 week estimate is likely on the light side.
Stay away from Drupal for any site that requires customized functionality. I recently used Drupal for a website at work, and it was VERY difficult to figure out how to get it to do what I wanted it to do. There is a lot of documentation out there, but all of it is unhelpful -- it answers very specific questions about specific issues but does not provide any context as to how you would approach building the site as a whole. If you're a programmer, using a more general framework will probably work better, as CMS's are designed for a specific kind of site, and if you want your site to have non-standard functionality you are going to be fighting the system instead of working with it. If your developers are most experienced in PHP, try one of the PHP frameworks that mimics the architecture of Rails -- e.g. cakePHP or CodeIgniter.
CMSes usually make sense when you have a broad and potentially expanding array of different content types and modes you need to handle. Drupal has literally dozens. Given than you mentioned RoR, it sounds like what you need is more of a MVC style framework. Maybe similar to the sort of thing stackoverflow was built with. .NET an issue for you?
If you are really limited to 3-5 weeks, however, I think a Rails-based strategy makes sense so go with RoR or CodeIgniter
If Drupal can do what you need easily I would say go with Drupal. I don't know much about Drupal though.
Otherwise, what you describe sounds like a data driven web app or more like a reporting app. It sounds like you might have some very specific needs or that users might want very specific needs in the future. That is something hard to get from premade software since you have no idea what users are going to request. Since I'm a programmer I would probably want to build it myself.
Funny you should ask... I just came across this in SD Time's Linkpalooza this afternoon:
Ten free powerful content management systems…
There are at least 4 more mentioned in the comments to this post.
It seems to make little sense to develop a new one with so many from which to choose!
BTW, this is neither a recommendation nor endorsement of any particular CMS.
Treat Drupal as a framework. Core modules + CCK + Views is a good start to build on.
If you're doing something that you might want to expose to other applications, consider the Services module. A lot of interesting things have been done with flex frontends connected to drupal running services with amfphp.