Off the shelf web-application scaffolding/directory-structure generators (Java/Java EE)? - installation

I was wondering if there is an off the shelf tool to help create a 'web application' directory structure with a basic application up and running? The source code would already be pre-written I'm guessing or based on the options some files may/may-not be generated.
I'm not sure what you'd call it but say we have a custom framework* which are to be used for web application development - rather than 'creating' a directory structure all the time we could just create it once and have a console like interface similar to the play framework to generate a basic application or an empty one as per the developer's choice.
We could just give various types of 'zip' files and ask folks to unzip it and import it in their IDE of choice and continue. However, we'd prefer to have an 'installable' to run from the command line (or GUI but no such preference) to have a basic application up and running without everyone wanting to do it all over again.
How does the Play framework do it? What do they use? (I'm guess similar things exist for RoR, Groovy/Grails.)
*It's not custom per se, but similar to having all the spring/hibernate/restlet/freemarker etc files pre-configured, up and running and a directory structure with packages for the various components by convention

I think one of the key points here regarding the Play framework is that it uses the concept of convention over configuration. Your applications are forced to follow the same pattern for the different parts of your application, or it will not work. I personally like this because it makes working on different projects easier, as the rules are always the same, rather the somewhat unwritten rules of best practice.
Java EE on the other hand takes the concept of configuration over convention. Therefore all your files and structures are defined in your relevant XML documents that specify your frameworks, classpaths, etc. There do exist some tools to try to bridge the gap. For example
IDE's will have project creation tools for your chosen framework, so will create a Struts or Spring MVC project structure with a few simple wizard steps. Eclipse does this for sure as one example.
Spring MVC also has Roo. This is a boilerplate code generation tool that creates large parts of your initial project for you.
From your description it seems you have a few different frameworks that you want to have auto-generated, but I don't think any tool currently will serve your purpose. Your concept of a zip file is your best bet here.

If you want a kind of scaffolding in the Java EE world, take a look at Appfuse which provides some archetype with several implementations on the views layer (JSF, Spring MVC, Struts 2...).

Related

How to customise a Laravel application

I'm total newbie with Laravel, so the question might not be the most intelligent, be gentle, please.
I'd like to use an Open Source application made with Laravel. However, the application does not fully suit my needs, hence some customization is needed.
Naturally, I don't what to change the application files and also want to keep all my files separated.
In other PHP-based applications there are typically methods to customise the app without touching any other code. Also, it is possible to have own code nicely in one place. For instance, Wordpress has a theme concept, child theme concept, plugins and hooks in code (filters and actions). In Magento we have a simple method of overriding a core file by copying it to local code pool, as well as a more sophisticated dependency injection, which allows to override any class anywhere.
I've been trying to understand what is the correct way to customise a Laravel application in such a way, that my own modifications are separated from the base application and e.g. updating the base is possible.
Please guide me, or give pointers on how to do this.
Sounds like Packages might be your best option.
https://laravel.com/docs/master/packages
They let you customize very much in your application without touching other parts of the code, as well as keeping it separated from the other parts of the application.
Here's a getting started guide on packages:
https://medium.com/#lasselehtinen/getting-started-on-laravel-package-development-a62110c58ba1

XPage Osgi plug in development

background
I have designed many tools in the past year or so that is designed to help me program for XPages. These tools include primarily helper java classes, extended logging (making use of OpenLogger and my own stuff), and a few other things that I personally feel I cannot work without. It has been discussed with my employer, and we feel that it might be a good idea to start publishing these items to openNTF. Since these tools are made up of about 3 .nsfs, all designed to use the same java code, key javascript classes, css, and even a custom control or two, I would like to consolidate key items into a plug-in that can be installed at the server and client level. I want to do this consolidation before I even think about publishing any of the work I've done so far. It would just be far too much work to maintain, not just for me, but for potential users. I have not really found any information on how to do such a thing in google searches. I also have to make sure that I am able to make use of the ExtLib libraries, openNTF Domino API, and the Notes API.
my questions
How does one best go about designing such plug-ins? Must a designer
use eclipse, or is this it possible to do this directly in the Notes
Designer?
How does a designer best go about keeping a server and client up to date while designing and updating the plug-in code? Is this why GitHub is often used?
Where is the best place to get material to get started in this direction? I sort of feel lost in the woods, knowing I need to head north, but not having a compass for that first step.
Thank you very much for your input.
In my experience, I found that diving into plug-in development is a huge PITA until you get used to it, but it's definitely worth it overall.
As for whether you can use Designer for plugin development: yes, but you will likely eventually want to not do so. I started out by using Designer for this sort of thing for a while, presumably with the same sentiment as you: why bother installing another instance of Eclipse when I'm already sitting in one all day? However, between Designer's age (it's roughly equivalent to, I think, Eclipse 3.4), oddities when it comes to working sets between the "Applications" and "Project Explorer" views, and, in my case, my desire to use a Mac app, I ended up switching.
There are two major starting points: the XSP Starter Kit (http://www.openntf.org/internal/home.nsf/project.xsp?name=XSP%20Starter%20Kit) and Niklas Heidloff's video on setting up Eclipse for XPages development (http://www.openntf.org/main.nsf/blog.xsp?permaLink=NHEF-8RVB5H). The latter mentions the XPages SDK (http://www.openntf.org/internal/home.nsf/project.xsp?name=XPages%20SDK%20for%20Eclipse%20RCP), which is also useful. In my setup, I found the video largely useful, but some aspects either difficult to find (IBM's downloads are shifting sands) or optional (debugging, which will depend on whether or not you're using Eclipse on Windows).
Those resources should generally get you set up. The main thing to worry about when setting up your Eclipse environment will be making sure your Plug-In Execution Environment is properly done. If you're following the SDK setup instructions, that SHOULD get you where you need to be.
The next thing to know about is the way plugins are structured. Each plugin you want to install in Designer or Domino will also be paired with a feature project (a feature can house several plugins), and potentially an update site - the last one is optional if you just want to import the features into an Update Site NSF. That's how I often do my normal plugin development: export the paired feature to a directory and then import the feature into the server's Update Site NSF and then install in Designer from there using Application -> Install. You can also set things up so that you deploy into the server's plugin/feature directories instead of taking the step of installing into an update site if you'd prefer. GitHub doesn't really come into play for this aspect - it's more about sharing/collaborating with your code and also having a remote storage location for your git repositories (which I highly advise).
And as for the "lost in the woods" feeling: yep, you'll have that for a good while. There are lots of moving parts and esoteric concepts to get a hold of all at once. If you mostly follow the above links and then start with some basics from the XSP Starter Kit (which is itself a plugin project that you can pair with a feature) - say, printing text in the Activator class and making an implicit global variable just to make sure it works - that should help get your feet wet.
It's best done in Eclipse. You can debug your code running on the server from there, as well as run it directly from there. The editors are also more up-to-date. You want:
Eclipse for RCP and RAP developers
XPages SDK for Eclipse RCP (from OpenNTF)
XPages Debug Plugin (from OpenNTF - basically allows you to load the plugins to the Domino server dynamically, rather than exporting to an Update Site all the time)
XSP Starter Kit on OpenNTF is a good starting point for a plugin. There are various references to the library id, which has to be unique for your plugin. Basically, references to org.openntf.xsp.starter need changing to whatever you want to call your plugin. You're also best advised to remove what you don't need. I tend to work in a copy of the Starter, remove stuff, build and if there are errors with required classes (Activator.java obviously will be required and some others), then paste them back in from the Starter.
XPages OpenLog Logger is a good cross-reference, that was built from XPages Starter Kit. It's pretty much stripped down and you'll be able to see what had to be changed. A lot of the elements of the XSP Starter Kit correspond to Java classes you'll probably be familiar with from your XPages Java development.
GitHub etc tend to be used as source control, which is useful for working out what's changed from time to time.

How can i use IoC in a asp.net webforms component (DotNetNuke module) without changing the infrastructure?

I'm working on legacy code in a DotNetNuke module, trying to get classes and behaviors under a testing framework: I'm taking this opportunity to follow advice from the "Working effectively with legacy code" book, so what happens is that i'm trying to define areas which can be tested thoroughly and then converted to services. Then i'd like to use an IoC framework for it to work. For now, i've set eyes on Ninject.
However i'm hitting a design problem: as i'm in a DotNetNuke module, i can't really change application-wide structure: for example i can't derive the Application from NinjectHttpApplication. I can't use these suggestions from SO either.
I was thinking about having the Kernel in a static class that my module would set up and then use but from what i've read around it's a very bad idea.
So i'm starting to ask myself if it's possible to use an IoC in an application that hasn't been set up to support it from scratch. If i'm supposed to have a whole dependency tree loaded for each request, how can i rewrite legacy code locally and benefit from IoC? Is there a pattern where IoC use can grow out from very local rewrites?
Even though i'm working with DotNetNuke, any standalone component that can be installed into an independent framework begs the same question. Also i'm not targeting Ninject specifically, if another IoC framework can help in this case i'm willing to consider it.
From my experience, your best bet to get this type of abstraction within the context of DotNetNuke is by using the WebFormsMVP framework. This is really the only sane way I've found to do unit testing in a DNN module, and if memory serves I spent awhile trying to wire up Ninject a year or so ago.
But be warned, it is still WebForms and will never be drop dead simple. And without knowing your existing code base, I'd have a hard time knowing how easy it will be to make the migration.
I have a couple of resources on GitHub that you can check out for reference:
The first is a module template that should act as a solid starting point:
https://github.com/irobinson/WebFormsMvp-DNN-Module-Template
The second is a small example project:
https://github.com/irobinson/BeerCollectionMVP
Depending on the version of DNN you're using, it may or may not already ship with WebFormsMVP, but you should be able to either bundle the dependencies w/ your module or upgrade to the newer version of DNN if that's reasonable.

Learning MVC 3, Seems better to create custom app and integrate with Orchard rather than build module?

I have been deliberating and deliberating. Orchard is clearly powerful and flexible, contains some very sophisticated code. I need to create some specific Wizard/Workflow functionality. I am also using Entity framework instead of NHibernate. It seems to me that it will be better to write this application seperately using simpler code, which I can refactor, and integrate into Orchard via a Wrapper Module, rather than getting caught up in writing a module afresh for the complete Wizard/Workflow. As I say I am learning MVC3 and do not want to overcomplicate my life, just deliver a solution. I will certainly use Orchard for typical CMS website features.
I also still have an unresolved issue of representing Organisations above users, which I have already resolved outside Orchard. This is only needed for the application rather than content management. So in the short term it may be that I keep the authentication seperate.
Does this sound the most pragmatic approach. If there was a good existing module then the decision would be easier. I think they are considering workflow for 1.7, but we are not there yet.
Many thanks,
Ed
It does sound like a safe path, yes.

Object Oriented Design with Ruby

What are some of the best practices for OOD with Ruby? Mainly, how should files and code be organized?
I have a project that uses several classes and files and I am just wondering how it should all be organized, grouped and included.
It sounds like you're asking which pieces go in which files.
Is your project a Web application? In that case you would most likely use the system of organization imposed by your framework (Rails, Merb, Sinatra, etc.)
Other kinds of projects also have their own typical structure that you can just follow. E.g. gems are usually set up in a certain way.
If it's a console app, there's no strict rule. Usually people put no more than one class or module in a file. You could have one main file that requires all the others.
Standard OOD concepts apply to ruby. For specifics, maybe this guide will be helpful:
http://www.rubyist.net/~slagell/ruby/oothinking.html

Resources