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.
Kategória: 
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.

Hozzászólások

Heya i am for the primary

Heya i am for the primary time here. I came across this board
and I in finding It really useful & it helped me out much.
I'm hoping to give one thing back and aid others such as you
helped me.

Hey very cool web site!! Guy

Hey very cool web site!! Guy .. Beautiful .. Superb ..

I'll bookmark your website and take the feeds additionally?
I am glad to find numerous helpful info here within the post,
we'd like work out extra strategies in this regard, thanks for sharing.
. . . . .

Hi there, There's no doubt

Hi there, There's no doubt that your web site could be having browser compatibility issues.
Whenever I look at your website in Safari, it looks fine however when opening in Internet Explorer, it has some overlapping issues.

I just wanted to give you a quick heads up! Aside from that, fantastic blog!

I read this post fully about

I read this post fully about the comparison of hottest and preceding technologies, it's amazing article.

Howdy, I do believe your blog

Howdy, I do believe your blog could be having web browser compatibility issues.
When I take a look at your blog in Safari, it looks fine but when opening in IE, it has some overlapping issues.
I just wanted to provide you with a quick heads up!

Aside from that, wonderful site!

My spouse and I absolutely

My spouse and I absolutely love your blog and find nearly all of your post's
to be just what I'm looking for. can you offer guest writers
to write content for you personally? I wouldn't mind
creating a post or elaborating on a lot of the subjects you write regarding here.
Again, awesome web log!

If you would like to increase

If you would like to increase your experience simply keep
visiting this site and be updated with the latest gossip posted here.

Why viewers still make use of

Why viewers still make use of to read news papers when in this technological
world all is available on net?

And that is an funding risk

And that is an funding risk worth taking.

Hi to all, the contents

Hi to all, the contents present at this website are in fact amazing for people knowledge, well,
keep up the nice work fellows.

Hi there! This blog post

Hi there! This blog post could not be written much better!
Going through this post reminds me of my previous roommate!
He continually kept talking about this. I am going to send this information to him.
Fairly certain he'll have a good read. Many thanks for sharing!

First off I would like to say

First off I would like to say fantastic blog! I had a quick
question which I'd like to ask if you do not mind.
I was interested to know how you center
yourself and clear your mind before writing.

I've had a tough time clearing my mind in getting my thoughts out there.

I truly do enjoy writing but it just seems like the first 10 to 15 minutes are wasted simply just
trying to figure out how to begin. Any recommendations
or hints? Kudos!

Its like you read my mind!

Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something.
I think that you could do with some pics to drive the message
home a little bit, but other than that, this is great blog.
An excellent read. I will definitely be back.

Excellent way of explaining,

Excellent way of explaining, and good article to get facts concerning my
presentation focus, which i am going to present in institution of higher
education.

An intriguing discussion is

An intriguing discussion is worth comment. I believe that you need to publish more on this issue, it might not be a taboo subject but usually folks don't discuss these subjects.

To the next! Many thanks!!

Hi, I do believe this is an

Hi, I do believe this is an excellent site.
I stumbledupon it ;) I will return once again since i have
saved as a favorite it. Money and freedom is the best way to change, may
you be rich and continue to guide others.

And that is an investment

And that is an investment risk worth taking.

Hi all, here every one is

Hi all, here every one is sharing these kinds of knowledge, thus it's pleasant to
read this blog, and I used to pay a quick visit this weblog daily.

Its like you learn my mind!

Its like you learn my mind! You appear to know so much
approximately this, such as you wrote the guide in it or
something. I believe that you just can do with some percent to force the message house a little bit, however other than that, this is magnificent blog.
A great read. I'll definitely be back.

Great blog! Do you have any

Great blog! Do you have any suggestions for aspiring writers?

I'm planning to start my own blog soon but I'm a
little lost on everything. Would you propose starting with a free platform like
Wordpress or go for a paid option? There are so many choices out there that I'm completely confused ..
Any ideas? Kudos!

I read this post fully about

I read this post fully about the resemblance of hottest and
previous technologies, it's awesome article.

Excellent pieces. Keep

Excellent pieces. Keep writing such kind of info on your site.
Im really impressed by it.
Hi there, You've done a fantastic job. I will definitely digg it and in my view recommend to my friends.

I'm sure they will be benefited from this website.

It's not my first time to pay

It's not my first time to pay a quick visit this site, i am visiting this web page dailly and get good facts from here everyday.

Very nice post. I just

Very nice post. I just stumbled upon your weblog and wished to say that I've truly enjoyed surfing around your blog posts.

After all I will be subscribing to your rss feed and I hope you write again soon!

Very great post. I simply

Very great post. I simply stumbled upon your weblog and wished
to say that I've truly loved surfing around your weblog posts.
After all I'll be subscribing in your feed and I am hoping you write once more soon!

I am sure this article has

I am sure this article has touched all the internet visitors,
its really really pleasant piece of writing on building up new weblog.

Excellent, what a blog it is!

Excellent, what a blog it is! This web site gives valuable facts to us,
keep it up.

I loved as much as you will

I loved as much as you will receive carried
out right here. The sketch is tasteful, your authored material stylish.
nonetheless, you command get got an impatience over that you wish be delivering the following.
unwell unquestionably come more formerly again since exactly the
same nearly a lot often inside case you shield this hike.

I’m not that much of a online

I’m not that much of a online reader to
be honest but your sites really nice, keep it up! I'll go ahead and bookmark your
website to come back down the road. Cheers

It's not my first time to pay

It's not my first time to pay a quick visit this website, i am browsing this site dailly and obtain good facts from
here everyday.

Hi there friends, its

Hi there friends, its impressive piece of writing concerning tutoringand completely defined, keep it up all the time.

Hi, i think that i saw you

Hi, i think that i saw you visited my web site thus i came to
“return the favor”.I'm attempting to find things
to enhance my site!I suppose its ok to use a few of your ideas!!

And this is an funding threat

And this is an funding threat value taking.

I all the time emailed this

I all the time emailed this website post page to all my associates, because if like
to read it then my contacts will too.

It's impressive that you are

It's impressive that you are getting thoughts from this article as well as from our discussion made here.

This is the right web site

This is the right web site for anyone who really wants to find out about this topic.
You understand so much its almost hard to argue with you (not that I personally will need to…HaHa).
You certainly put a new spin on a topic that's been discussed for years.
Excellent stuff, just wonderful!

What a data of un-ambiguity

What a data of un-ambiguity and preserveness of valuable knowledge regarding unexpected feelings.

It is not my first time to

It is not my first time to pay a quick visit this website, i am browsing
this web site dailly and get fastidious facts from here everyday.

Hi there to all, how is

Hi there to all, how is everything, I think every one is getting more from this site, and your views are fastidious in support
of new users.

I for all time emailed this

I for all time emailed this blog post page to all my contacts, since if like to read it then my friends will too.

Do you mind if I quote a few

Do you mind if I quote a few of your articles as long as I provide credit and sources back
to your blog? My website is in the exact same area of interest as yours and my
visitors would really benefit from a lot of the information you provide here.
Please let me know if this alright with you. Cheers!

Good way of describing, and

Good way of describing, and good piece of writing to get information about my
presentation topic, which i am going to deliver in college.

Touche. Solid arguments. Keep

Touche. Solid arguments. Keep up the good spirit.

I am in fact delighted to

I am in fact delighted to read this weblog posts which includes plenty of valuable information, thanks for providing these kinds of information.

whoah this weblog is

whoah this weblog is fantastic i love reading
your posts. Keep up the good work! You understand, lots of people are
hunting around for this information, you can help them greatly.

Excellent post. I was

Excellent post. I was checking continuously this blog and I'm impressed!

Extremely helpful info specifically the last part :
) I care for such info a lot. I was looking for this certain info
for a very long time. Thank you and best of luck.

And this is an funding threat

And this is an funding threat price taking.

Thanks for your personal

Thanks for your personal marvelous posting! I truly enjoyed reading it,
you may be a great author. I will make sure to bookmark your blog and will come back sometime
soon. I want to encourage yourself to continue
your great work, have a nice day!

Great article, exactly what I

Great article, exactly what I needed.

It's awesome designed for me

It's awesome designed for me to have a website, which
is good designed for my knowledge. thanks admin

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <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].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.