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

I like it when individuals

I like it when individuals come together and share ideas. Great blog,
stick with it!

Good blog you've got here..

Good blog you've got here.. It's difficult to find good quality writing like yours nowadays.
I truly appreciate individuals like you! Take care!!

A financial advisor is your

A financial advisor is your planning companion.

I like reading a post that

I like reading a post that can make people think.
Also, thank you for allowing me to comment!

Oh my goodness! Amazing

Oh my goodness! Amazing article dude! Thanks, However I am having
troubles with your RSS. I don't understand why I can't join it.

Is there anybody else having identical RSS problems?
Anyone who knows the solution will you kindly
respond? Thanks!!

I was recommended this blog

I was recommended this blog by my cousin. I'm not sure
whether this post is written by him as nobody else know such detailed about my trouble.
You are wonderful! Thanks!

I'm extremely impressed

I'm extremely impressed together with your writing talents as neatly as with the format in your weblog.
Is that this a paid subject or did you modify it
your self? Anyway keep up the excellent quality writing, it's uncommon to see
a nice weblog like this one these days..

Thanks on your interest in

Thanks on your interest in Investment Advice.

Marvelous, what a weblog it

Marvelous, what a weblog it is! This web site gives useful data to us,
keep it up.

Hello, I enjoy reading all of

Hello, I enjoy reading all of your post.
I wanted to write a little comment to support you.

Thanks for sharing your

Thanks for sharing your thoughts on ig. Regards

What's Taking place i'm new

What's Taking place i'm new to this, I stumbled upon this I have found It positively helpful
and it has aided me out loads. I'm hoping to contribute & aid other
customers like its aided me. Good job.

An intriguing discussion is

An intriguing discussion is worth comment. I do believe that you ought to write more on this subject
matter, it might not be a taboo subject but generally people do not talk about these
topics. To the next! Kind regards!!

Woah! I'm really digging the

Woah! I'm really digging the template/theme of this blog.
It's simple, yet effective. A lot of times it's very hard to get that "perfect balance" between usability and visual appearance.
I must say you've done a fantastic job with this.
Also, the blog loads very fast for me on Internet explorer.
Outstanding Blog!

Hi there Dear, are you really

Hi there Dear, are you really visiting this web page regularly, if so after that you will absolutely obtain good experience.

I know this if off topic but

I know this if off topic but I'm looking into
starting my own blog and was wondering what all is needed to get setup?
I'm assuming having a blog like yours would cost a pretty penny?
I'm not very internet smart so I'm not 100% positive.
Any tips or advice would be greatly appreciated. Kudos

Keep this going please, great

Keep this going please, great job!

I do agree with all the ideas

I do agree with all the ideas you have introduced on your
post. They're really convincing and will definitely work. Still, the
posts are too short for starters. May just you please extend them a bit from next time?
Thanks for the post.

What's up to every one, the

What's up to every one, the contents existing
at this site are truly awesome for people knowledge, well, keep up
the nice work fellows.

Nice respond in return of

Nice respond in return of this question with solid
arguments and explaining the whole thing regarding that.

Hello there! I could have

Hello there! I could have sworn I've been to this website
before but after reading through some of the post I realized it's new to me.
Nonetheless, I'm definitely delighted I found it and I'll be bookmarking and checking back often!

It's very effortless to find

It's very effortless to find out any matter on web as compared to books, as
I found this post at this web page.

Asking questions are actually

Asking questions are actually fastidious thing if you are not understanding anything completely, however this
article presents good understanding yet.

We are a gaggle of volunteers

We are a gaggle of volunteers and opening a new scheme in our community.

Your web site provided us with valuable info to work on. You've done
an impressive process and our whole neighborhood
will probably be grateful to you.

Hello, this weekend is

Hello, this weekend is pleasant in support of
me, for the reason that this occasion i am reading this great educational paragraph here at my residence.

I visited many web sites

I visited many web sites however the audio feature for audio songs existing at this
web site is really marvelous.

What i don't understood is if

What i don't understood is if truth be told how you are now not really a lot more smartly-appreciated
than you may be right now. You're so intelligent. You already
know therefore considerably with regards to this topic, produced me individually consider it from so
many numerous angles. Its like women and men don't seem to
be fascinated unless it is something to do with Girl
gaga! Your personal stuffs outstanding. Always take care of it up!

Hello, i read your blog

Hello, i read your blog occasionally and i own a similar
one and i was just wondering if you get a lot of spam remarks?
If so how do you stop it, any plugin or anything you can advise?
I get so much lately it's driving me mad so
any support is very much appreciated.

Howdy! I realize this is sort

Howdy! I realize this is sort of off-topic however I
needed to ask. Does building a well-established
blog like yours require a massive amount work? I'm completely new to writing
a blog however I do write in my journal everyday. I'd like
to start a blog so I can easily share my personal experience and views online.
Please let me know if you have any suggestions or tips for brand new
aspiring blog owners. Appreciate it!

Tremendous issues here. I am

Tremendous issues here. I am very glad to peer your post.
Thanks so much and I am looking ahead to contact you. Will you
please drop me a e-mail?

WOW just what I was looking

WOW just what I was looking for. Came here by searching for ig

Terrific article! This is the

Terrific article! This is the type of info that are supposed to be shared across the net.

Disgrace on Google for not positioning this publish upper!
Come on over and seek advice from my website .
Thanks =)

Admiring the time and energy

Admiring the time and energy you put into your blog and in depth information you provide.
It's great to come across a blog every once in a while that isn't
the same out of date rehashed material. Fantastic read!
I've saved your site and I'm including your RSS feeds to my Google account.

You are so awesome! I do not

You are so awesome! I do not think I've truly read anything like this before.
So nice to discover another person with original thoughts
on this issue. Seriously.. thank you for starting this up.
This website is one thing that is required on the internet, someone with a
little originality!

Quality posts is the key to

Quality posts is the key to attract the visitors to go to see the web site, that's what this web page is providing.

I always spent my half an

I always spent my half an hour to read this web site's articles everyday along with a cup of coffee.

Hello, everything is going

Hello, everything is going perfectly here and ofcourse every one is sharing data,
that's really good, keep up writing.

I have been exploring for a

I have been exploring for a little for any high-quality articles or blog posts on this kind of area .

Exploring in Yahoo I eventually stumbled upon this website.
Studying this information So i am happy to convey that I have an incredibly just right
uncanny feeling I discovered exactly what I needed.
I so much unquestionably will make certain to
don?t omit this web site and give it a look regularly.

It's nearly impossible to

It's nearly impossible to find knowledgeable people about this topic,
however, you sound like you know what you're talking about!
Thanks

Hi, I do think this is a

Hi, I do think this is a great web site. I stumbledupon it ;)
I am going to revisit once again since i have book marked it.
Money and freedom is the greatest way to change, may you be rich and continue to help other people.

Heya i am for the first time

Heya i am for the first time here. I came across this board and
I find It really useful & it helped me out a lot.
I hope to give something back and aid others like you helped me.

Really no matter if someone

Really no matter if someone doesn't know afterward its
up to other users that they will assist, so here it occurs.

What's up to every one, the

What's up to every one, the contents existing at this website are actually remarkable for
people experience, well, keep up the good work fellows.

magnificent issues

magnificent issues altogether, you simply received a new reader.
What may you recommend in regards to your put up that you just made a few days in the past?
Any certain?

Hi everyone, it's my first

Hi everyone, it's my first pay a visit at this web page, and post
is really fruitful in favor of me, keep up posting these types of content.

whoah this blog is

whoah this blog is magnificent i like studying your articles.
Stay up the good work! You know, lots of individuals are
searching round for this information, you could aid them greatly.

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.

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.