Introducing a best practice approach to development is hugely important for the longevity and maintainability of your application. You can have no confidence in changing code if you have no way to prove that the change is not breaking the functionality. This neat way of testing code in a standalone fashion is one of the basic tenets we apply to development at Manifesto. In fact, those initial steps describing re-factoring and testing give you a whole new level of confidence in your code base. No chance to pause – your code is redeployed and available for use immediately you save it.Use the secret sauce to deploy your code changes as you make them.Derive and matriculate in the Actions and use the Templates to surface that information. Finally, put the last element of this re-factoring in place by starting to use Action classes to load your asset data for a Template, and making use of those Java classes and POJOs you’ve just written.Rip out the dependency on the ICS and use Mockito where you must. Create POJOs and use them in conjunction with your business logic to enable a well-testable codebase. Make these classes functional but not too heavy. Next, rip out the business logic from your Templates and add this code to proper Java classes.JSTL is so much better than the WCS tags and removes a lot of the clutter in a Template. Now, continue with your re-factoring and consider using JSTL in those Templates.Then, start to re-factor the whole delivery experience by taking the first step and examining that logic in the Template and then removing as many of the WCS tags as you can.The GSF is Open Source, but written by folks with years of experience of poking round the WCS innards. To that end, download and install the GSF foundation classes for your WCS release (11g or 12c). Start thinking MVC and look at those Templates as Views. Firstly, you need to re-asses the way you work with Templates.I’m no doctor, but let me prescribe the following approach What’s a developer to do? A roulette-free approach To make it safe, it’s definitely a good idea to mark it with a TODO: just so that everyone knows the code was delivered with the best intentions and in the smallest amount of time. And, do you know what, why can’t you iterate that list, or look for all the assets in an association, or even just set a counter variable for use later in the template. After all, they must have created those tag libraries for a reason. You’re constantly trying to avoid deploying JARs and classes to WCS, in fear of the overhead that incurs and so you tell yourself that you’ll re-factor the code eventually. Of course, you can re-deploy to some app servers, and hope you get away with it, but that’s a gamble … And that’s how it begins: the PermGen Roulette WCS anti-pattern You have deadlines to meet and waiting for that application server to restart for each re-deploy just wastes valuable minutes of your day. You even thought about using Groovy at one point, but that just wasn’t your style. You do it because adding code to a JAR file and redeploying it every time that code changes is painful. You know, the one where you end up putting business logic in Templates and CSElements. We’ll also see how we can crush the number one problem that we face as WCS developers the problem of deployment. In this post I’ll look at how we can work to alleviate the worst of them by creating more testable code that focusses directly on the task in hand. Activiti-jar-blog Activiti Jar Module - SDK 3Īctiviti JAR Module that produces a JAR file with Java extensions such as service task delegates.Bad habits can creep in to the WebCenter Sites development cycle.
0 Comments
Leave a Reply. |