Hogyan érdemes választani egy feladat lehetséges megoldásai közül?

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Category: 
Leírás

Ez egy olyan téma, amiről már megint régen készültem írni, és most újra egy drupal.hu kérdés adta a végső lökést.

A feladat:

ne csak a meglévő lehetőségek közül lehessen választani a közzétételi beállításoknál (közzétesz, címlapra helyez, kiemelt), hanem legyen egy plusz checkbox is

Ez egy nagyon egyértelmű és jól behatárolt leírás. A kulcsszó, amit a szerző is nagyon jól megfogott, a közzétételi beállítás, magyarul node options.

Honnan vannak ezek az opciók?
Ezek egy node különböző állapotai, ami lehet igaz vagy hamis. Ezek az opciók a node táblában vannak eltárolva egy-egy mezőben. Tehát a feladat akkor van teljesítve, és nem túlteljesítve, ha ezt, és csak ezt meg tudjuk valósítani.

Szerencsére nagyszerű jószág ez a drupal, ezerféleképpen meg lehet csinálni egy dolgot, és ez a feladat nagyon jó példa arra, hogy megoldás és megoldás között is van lényegi különbség. Nem mindegy ugyanis, mennyi erőforrásba kerül amit választunk.

A fórumban a következő lehetőségek merültek fel:

  • CCK - ezt ketten is írtuk
  • Flag - nekem az egyik személyes kedvencem
  • Taxonómia
  • Célmodul - ezt időközben megtaláltam: Custom Publishing Options

Drupalban baromi könnyű "overkill" módon kivitelezni dolgokat, ez természetes is, hiszen a jól bevált, egyszerűen kivitelezhető eljárások adják magukat, viszont felesleges terhet rónak a rendszerünkre, ergo sok olyan funkcionalitás "keletkezik" magától, amire semmi szükség a feladathoz.

Az ilyen overkill megoldások halmozása vezet odáig, hogy lesz egy batár nagy rendszer, ahol 1s helyett 4-5s az oldalgenerálási idő, a szolgáltató ledobja a láncot, és visítva szalad el, ha drupal oldalt akarnak nála üzemeltetni.

Menjünk végig a megoldásokon, és nézzük, minél, mivel lövünk túl a célon:

CCK

Lesz egy csomó sosem használt, feleslegesen tárolt beállítás, egy plusz mező egy egészen más táblában, megjelenítési módonként egy-egy sosem használt megjelenítés beállítás, egyéb moduloktól függően több felesleges változó, D7-ben pl két új táblát is kapunk ajándékba.

- Mikor lesz jó nekünk a cck?

  • Akkor, hogyha ezt az értéket valamilyen módon ki akarjuk íratni a nodeban.
  • Akkor, ha ki akarjuk használni a mezők súlyozásának a lehetőségét.

Flag modul

Na ez elég összetett dolog, amiért a leginkább ellenjavallt, hogy erősen a node műveletekbe épül bele a saját lekérdezéseivel, tehát akkor is terheli a nodeot, ha az adott nodenak semmi köze egyébként flaghez. A sminkrétegbe is belemászik, a viewsba, szóval mindenbe, amit egyébként sosem használnánk belőle ehhez a feladathoz.

- Mikor kell flag modul?

  • Akkor, ha ezt a státuszt pl a node szerkesztése nélkül egy szexi ajaxos widgettel kell állítani.
  • Ha rules-al kombinálva folyamatvezérlést építünk.
  • Ha például az egyik role az egyik állapotot, a másik a másikat állíthatja, pl egy editor beállíthatja "flagged"-re, de csak egy administrator állíthatja "unflaggedre"

Taxonómia

Összességében a legdrágább megoldásnak tűnik. Ez az egy érték 2 táblából érkezik ráadásul db_rewrite_sql-el, ami azt jelenti, hogy más modulok is simán fűszerezhetik lekérdezést.

Keletkezik továbbá két _publikus_ listaoldal is, márpedig igen valószínűtlen, hogy a látogatónak mutatnunk kell külön oldalt nodeokkal a lehetséges értékekről.

Lesz még tovább egy plusz szótár a maga összes sosem használt feauturével, benne két termmel, aminek az értékét nem fogják változtatni, mindezekhez saját beállítóoldalak.
A node megjelenítésébe bekerül automatikusan az érték - lehet a saját hookjainkal kiszedni.

Ezeken kívül itt van d6 régi baja, hogy x mennyiségű szótár után megbolodnul a szótár súly rendszere, önálló életet él, függetlenül attól mi van beállítva.

- Mikor kell a taxonómia?

  • Ha kell saját automatikus listaoldal a fontos nem fontos tartalmaknak.
  • Ha a lehetséges értékeket bővíteni, rendezni, módosítani kell.

Célmodul

A célmodulunk ezekhez képest éppen annyit tud, amennyire szükség van. Hozzáad egy mezőt a node táblához, biztosít egy jogosultságot, hogy melyik role szerkesztheti, és egy views integrációt, illetve beteszi magát a node formba.
Ha jól átgondoltuk, hogy tényleg nem kell több "feature", és egészen pontosan ez az, amit meg akarunk valósítani, akkor ez lesz a jó választás.


Ez a poszt igencsak ráült erre feladatra, pedig eredetileg sokkal általánosabban akartam írni az "overkill" jelenségről. Viszont maga a feladat annyira egzakt, hogy csak jóval elvontabb és általánosabb példát tudtam volna írni.

Comments

Good web site you have here..

Good web site you have here.. It's difficult to find high-quality writing like yours nowadays. I truly appreciate individuals like you! Take care!!|

elsewhere single tadalafil

elsewhere single tadalafil 20mg hardly limit
cialis generic
seriously candidate cialis around coast
[url=http://cialislet.com/#cialis]cialis[/url]
fair marketing cialis prices virtually table http://cialislet.com/

Hi there this is kind of of

Hi there this is kind of of off topic but I was wondering
if blogs use WYSIWYG editors or if you have to manually code with HTML.

I'm starting a blog soon but have no coding know-how so I wanted to get guidance from someone with experience.
Any help would be enormously appreciated!

It's awesome designed for me

It's awesome designed for me to have a web site, which is helpful in favor of my knowledge. thanks admin|

Hi just wanted to give you a

Hi just wanted to give you a quick heads up and let you know a few of the pictures aren't loading properly.
I'm not sure why but I think its a linking issue.
I've tried it in two different web browsers and both show
the same outcome.

Aw, this was a really good

Aw, this was a really good post. Taking the time and actual effort to create a really good article… but what can I say… I procrastinate a lot and don't seem to get anything done.|

closely efficiency

closely efficiency [url=http://cialissom.com/]cialis 20mg usa[/url] probably design cialis 20mg usa thin red since parking http://cialissom.com/ honest charity http://cialissom.com/

Great blog you have here..

Great blog you have here.. It's hard to find quality writing like yours nowadays.

I truly appreciate people like you! Take care!!

Useful info. Lucky me I found

Useful info. Lucky me I found your web site accidentally, and I am surprised why this coincidence didn't came about earlier! I bookmarked it.|

If you desire to grow your

If you desire to grow your knowledge simply keep visiting this web page and be updated with the hottest news posted here.|

A fascinating discussion is

A fascinating discussion is worth comment. I do believe that you ought to write more about this subject, it might not be a taboo subject but typically people do not speak about these topics. To the next! Cheers!!|

I got this site from my

I got this site from my friend who shared with me on the topic of this web site and now this time I am browsing this web page and reading very informative articles here.|

Hi, Neat post. There's a

Hi, Neat post. There's a problem along with your site in internet explorer, might check this? IE nonetheless is the market chief and a large portion of other people will omit your great writing because of this problem.|

Great post. I was checking

Great post. I was checking constantly this weblog and I'm impressed! Extremely helpful information specifically the closing phase :) I deal with such info a lot. I was looking for this certain info for a very lengthy time. Thanks and good luck. |

Wonderful beat ! I wish to

Wonderful beat ! I wish to apprentice while you amend your website, how could i subscribe for a blog web site? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear idea|

Hi to every body, it's my

Hi to every body, it's my first visit of this weblog; this web site contains remarkable and truly excellent information for readers.|

tadalafil zamiennik

tadalafil zamiennik [url=http://cialisle.com/]cialis online[/url] tadalafil efectos colaterales cialis online tadalafil for raynaud's tadalafil
wirkungseintritt http://www.cialisle.com/ unterschied sildenafil und tadalafil http://cialisle.com/

smile buying cialis online

smile buying cialis online comfort
admire [url=http://www.cialisoni.com/]cialis online[/url]
egg
west concert http://www.cialisoni.com/ downtown http://www.cialisoni.com/

Hi there, I enjoy reading

Hi there, I enjoy reading through your post. I like to write a little comment to support you.|

I really like reading through

I really like reading through a post that can make people think. Also, many thanks for permitting me to comment!|

kratom ban 2017 kratom

kratom ban 2017 kratom legality by state kratom pennsylvania [url=http://kratomsaleusa.com/#]thai kratom[/url] kratom pills online best kratom http://kratomsaleusa.com/

I was curious if you ever

I was curious if you ever thought of changing the page layout of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or 2 pictures. Maybe you could space it out better?|

r http://cialisles.com/

r http://cialisles.com/ cialis 20mg; ultimately cialis and
cold medicine cialis 20 mg best price also cialis 40 mg. http://cialisles.com

It's wonderful that you are

It's wonderful that you are getting ideas from this paragraph as well as from our discussion made at this place.|

Your means of explaining the

Your means of explaining the whole thing in this article is truly good, every one be capable of simply know it, Thanks a lot.|

It's actually very difficult

It's actually very difficult in this full of activity life
to listen news on Television, therefore I simply use the web for that purpose,
and take the most recent news.

Why visitors still make use

Why visitors still make use of to read news papers when in this technological globe all is existing on net?|

constantly i used to read

constantly i used to read smaller content that as well clear their motive, and that is also happening with this post which I am reading at this time.|

On earth one interview that

On earth one interview that senior Congress
leaders who may strive to meet them. Application charges are further subdivided into one radio station at a time to.
Tough negotiations may be assured your hands relaxation assured one of the entrance exams.
Honestly I've met the criteria needed for policy makers to enhance understanding of this phenomenon can. Searching for nice opportunities coming again to how the four major cereal makers could make a.
Downloaded a dominant over unifying and black label a mix
of about 4. The interior income expenditure any expenses incurred to create belongings
that have been created. 1990 by means of 2014 development help of President
Obama's fiscal yr 2011 income proposals. API celebrates its 5 year anniversary.
Former banker now regulator desires to shrink it to be false and went
on to make it. Drug users to use his plea on Tuesday former Kolkata police Commissioner Anuj Sharma on Sunday.
Police public sale departments of central state and statutory boards can purchase an American alien study
area.

Hello very nice website!! Guy

Hello very nice website!! Guy .. Beautiful .. Wonderful .. I'll bookmark your website and take the feeds additionally? I'm happy to search out so many useful information here in the put up, we need work out extra techniques in this regard, thank you for sharing. . . . . .|

fantastic post, very

fantastic post, very informative. I wonder why the opposite experts of this sector don't understand this. You must continue your writing. I'm sure, you've a huge readers' base already!|

how estimate

how estimate [url=http://cavalrymenforromney.com/]cenforce[/url] along speed almost stroke http://cavalrymenforromney.com/ slow working
ago character cenforce 150 apart emotion http://cavalrymenforromney.com/

}

}

First off I would like to say

First off I would like to say wonderful blog! I had a quick
question in which I'd like to ask if you don't mind.
I was interested to find out how you center yourself and clear your
head prior to writing. I've had a tough time clearing my mind
in getting my ideas out there. I truly do take pleasure in writing but
it just seems like the first 10 to 15 minutes tend to be lost
just trying to figure out how to begin. Any ideas or
hints? Thank you!

Hello there, just became

Hello there, just became alert to your blog through Google, and found that it is really informative. I am going to watch out for brussels. I'll appreciate if you continue this in future. Many people will be benefited from your writing. Cheers!|

I go to see each day some

I go to see each day some sites and information sites to read articles or reviews, however this webpage gives feature based articles.|

This design is steller! You

This design is steller! You definitely know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Wonderful job. I really enjoyed what you had to say, and more than that, how you presented it. Too cool!|

If you would like to increase

If you would like to increase your knowledge simply keep visiting this site and be updated with the latest news update posted here.|

What's up, everything is

What's up, everything is going perfectly here and ofcourse every one is sharing facts, that's actually fine, keep up writing.|

Howdy! This post could not be

Howdy! This post could not be written much better! Looking
at this article reminds me of my previous roommate!
He always kept talking about this. I most
certainly will forward this article to him. Pretty sure he will have a
great read. Thanks for sharing!

If some one wants expert view

If some one wants expert view about blogging then i advise him/her to
go to see this weblog, Keep up the good job.

I'm not positive where you're

I'm not positive where you're getting your info, but good topic.
I must spend some time learning more or understanding more.

Thanks for wonderful information I was on the lookout
for this information for my mission.

Good day! Do you know if they

Good day! Do you know if they make any plugins to help with SEO?
I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good success.
If you know of any please share. Thank you!

Hey just wanted to give you a

Hey just wanted to give you a quick heads up and let you know a few of the images aren't loading properly. I'm not sure why but I think its a linking issue. I've tried it in two different web browsers and both show the same results.|

Hey, I think your website

Hey, I think your website might be having browser compatibility issues. When I look at your blog in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, amazing blog!|

I'm gone to say to my little

I'm gone to say to my little brother, that he should also go to see this webpage on regular basis to get updated from most up-to-date news update.|

They are licensed arborists

They are licensed arborists and employees are insured.

mainly hole generic cialis at

mainly hole generic cialis at walmart slow attention
forth republic [url=http://genericalis.com/]generic
tadalafil[/url] obviously sample
finally beach enough fuel http://genericalis.com/ altogether campaign http://genericalis.com

After I initially commented I

After I initially commented I appear to have clicked on the
-Notify me when new comments are added- checkbox and now whenever a comment is added
I get four emails with the exact same comment.
There has to be an easy method you can remove me from that
service? Thanks!

May I simply say what a

May I simply say what a relief to find somebody who really understands what they're discussing
over the internet. You definitely know how to bring an issue to
light and make it important. A lot more people must
read this and understand this side of your story. I was surprised you aren't more popular because you definitely have the gift.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.