The fea­tures mod­ule is great for manag­ing Dru­pal projects.

OpenSource For You - - GUEST COLUMN EXPLORING SOFTWARE -

Graph­i­cal de­vel­op­ment in a CMS like Dru­pal 7 is won­der­ful. It is pos­si­ble to de­velop com­plex sites with very lit­tle cod­ing. It is also great for get­ting started, es­pe­cially for small sites. The anx­i­ety be­gins when the site starts get­ting larger—and there's a set of de­vel­op­ers, not just you alone.

As the com­plex­ity of the site in­creases, you need to sep­a­rate the de­vel­op­ment en­vi­ron­ment from the pro­duc­tion en­vi­ron­ment. You may want to have a sep­a­rate test­ing en­vi­ron­ment as well. For de­vel­op­ment, you need min­i­mal rep­re­sen­ta­tive data. For test­ing, you may need sim­u­lated data in or­der to test for scal­a­bil­ity and per­for­mance. The last thing you want, as a de­vel­oper, is to be re­mem­bered for mess­ing up live con­tent—and the safest way to en­sure that doesn’t hap­pen is to stay away from the op­er­a­tional site!

Since the data about the site and the con­tent are in the same data­base, you may want to se­lec­tively back up and re­store parts of the data­base. How­ever, it is usu­ally sim­pler to do the de­vel­op­ment, and when ev­ery­thing is work­ing well, re­peat the steps on the test and the de­ploy­ment sites.

If the steps are be­ing re­peated, how do you en­sure that no PousH FOLFk oU fiHOG HnWUy Ls GLIIHUHnW Ln WhH OLYH sLWH IUoP WhH de­vel­op­ment site? And later, when mul­ti­ple de­vel­op­ers are in­volved, you will need to know who did what, and when.

How do you keep track of fea­tures be­ing added to your site? It would be much sim­pler if the changes you make in Dru­pal 7 us­ing the graph­i­cal in­ter­face could be saved as a text fiOH, whLFh FouOG bH usHG Wo LPSOHPHnW WhH sDPH FhDngHs Ln the test and de­ploy­ment servers. You could fur­ther im­ple­ment source code con­trol us­ing a repos­i­tory like Git or Sub­ver­sion. This is what you may do with UML mod­el­ling tools like ArgoUML, or form de­sign tools like Glade.

Since this need is hardly unique, in all prob­a­bil­ity, some­body must have im­ple­mented a so­lu­tion—and, in­deed, they have. The fea­tures mod­ule ( http://dru­pal.org/project/ fea­tures) is one such so­lu­tion. sta­tis­tics at http://dru­pal.org/project/us­age.

I agree with the fol­low­ing com­ment in http://codekarate. com/blog/top-ten-best-dru­pal-7-con­trib-mod­ules : “If you aim to be­come a se­ri­ous Dru­pal de­vel­oper, you can't live with­out the fea­tures mod­ule. You may think of a fea­ture as a use case. Or you may want to group all changes you made to a Dru­pal site that im­ple­ment some user need.” But what does that mean? Your new re­quire­ment may be to add new vo­cab­u­lary in the tax­on­omy mod­ule. The next step would be that you may re­quire ad­di­tional con­tent types, which may use the ad­di­tional vo­cab­u­lary you hDYH GHfinHG. )LnDOOy, WhLs FonWHnW nHHGs Wo bH YLHwHG—IoU whLFh you PDy nHHG Wo GHfinH FusWoP YLHws. Sub­sHTuHnWOy, you wLOO nHHG Wo GHfinH PHnu OLnks, SHUPLssLons, HWF.

Af­ter you have added the needed func­tion­al­ity, you are ready to GHfinH D nHw IHDWuUH. GLYH LW D suLWDbOH nDPH, DnG HGLW FoPSonHnWs to add to this fea­ture. It is re­mark­ably sim­ple. You will need to add the stron­garm mod­ule in or­der to ex­port the vo­cab­u­lary.

When all the com­po­nents have been added to the fea­ture, ex­port it as a tar fiOH, whLFh FDn WhHn bH GHSOoyHG on Dny oWhHU sysWHP. You may want to go through a tu­to­rial to un­der­stand the steps—for ex­am­ple, http://www.os­train­ing.com/blog/dru­pal/fea­tures/.

If you make changes to any of the com­po­nents, or add com­po­nents to your fea­tures, you can re-ex­port the re­vised fea­ture, and de­ploy the updated ver­sion on the other sys­tems. The con­tent of the tar fiOH FDn bH DGGHG Wo D UHSosLWoUy OLkH GLW, and you have ver­sion con­trol for the fea­ture. If ev­ery ca­pa­bil­ity of your site is part of some fea­ture, your en­tire site is man­aged by ver­sion con­trol. The code for the site is now in the repos­i­tory and dis­tinct from the con­tent.

You can choose to ap­ply (or ig­nore) the ad­vice and method­olo­gies of soft­ware engi­neer­ing while de­vel­op­ing Dru­pal 7 projects as well—but you won't be able to say that it can't be done!

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.