Tạo ứng dụng web nhanh và đơn giản với Grails (Phần 1)

Posted in Grails, Groovy, J2EE, Java, LightWeight J2EE with tags on Tháng Một 26, 2010 by hadv
Trước tiên bạn cần download grails framework phiên bản mới nhất từ trang chủ của grails (http://www.grails.org/Download). Phiên bản mới nhất tại thời điểm viết bài này là 1.1.2. Tuy nhiên, tôi sử dụng phiên bản grails 1.0.1 để làm demo trong bài viết này.

Sau khi download thành công file grails.zip về máy; các bạn giải nén vào một thư mục bất kỳ và tạo một biến môi trường GRAILS_HOME trỏ đến thư mục mà các bạn chọn để giải nén ở trên như ở Hình 1. Các bạn có thể thấy là các thư viện chuẩn cần để lập trình web động như Spring, Hibernate, SiteMesh, Jetty và một số thư viện hỗ trợ cho việc build, ant, và hỗ trợ chạy unittest, junit, cũng đã tích hợp sẵn vào trong grails rồi.

Hình 1: GRAILS_HOME

Ngoài ra, các bạn cũng cần chắc chắn là đã thiết lập chính xác đường dẫn của JAVA_HOME; ví dụ như trong Hình 2 và đã thêm đường dẫn đến thư mục [bin] của grails vào biến môi trường %PATH% của Windows như trong hình Hình 3.

Hình 2: JAVA_HOME
Hình 3: PATH

Sau khi đã thiết lập các biến môi trường xong, để kiểm tra xem grails đã được cài chính xác hay chưa, các bạn hãy mở cửa sổ command line và gõ lệnh grails như sau:

C:\Documents and Settings\hadv>grails

Hoặc

C:\Documents and Settings\hadv>grails help

Nếu các bạn thấy output ra màn hình command như bên dưới thì nghĩa là grails đã được cài đặt thành công và bạn đã có thể bắt đầu công việc thú vị là tạo một trang web động.

—————————————————————
Welcome to Grails 1.0.1 – http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\dev\java\grails-1.0.1\grails
—————————————————————————-

Để tạo bộ khung source code cho một dự án web sử dụng grails rất đơn giản; bạn chỉ cần gõ lệnh như sau để tạo một dự án có tên là [LovePoem]

C:\dev\java\workspace>grails create-app LovePoem

Kết quả grails sẽ chạy các script có sẵn như trong Hình 4 để tạo ra bộ khung source có cấu trúc thư mục như trong Hình 5

Hình 4: Kết quả chạy script trên màn hình command line
Hình 5: Cấu trúc thư mục

Sau đó, các bạn chuyển đến thư mục dự án [LovePoem] vừa được tạo và gõ lệnh [grails run-app] để chạy thử trên Jetty như sau:

C:\dev\java\workspace\LovePoem>grails run-app

Cuối cùng thì bạn mở browser và truy cập vào địa chỉ [http://localhost:8080/LovePoem] bạn sẽ thấy màn hình như trong Hình 6 xuất hiện và cũng có nghĩa là bạn đã tạo thành công một dự án có sử dụng grails.

Hình 6: Màn hình mặc định của Grails

Đến đây thì bạn sẽ thắc mắc là đã tạo được cái gì đâu? Đúng như vậy, các bạn hãy kiên nhẫn đợi đến bài viết sau; tôi sẽ trình bày cách tạo các domain, các event và các services, các controller,… cũng như việc kết nối với database để có thể tạo ra một ứng dụng web hoàn chỉnh.

Securing Java applications with Acegi

Posted in Acegi, J2EE, Java, Security with tags , , , on Tháng Hai 22, 2008 by hadv

Securing Java applications with Acegi, Part 1: Architectural overview and security filters
This series introduces Acegi Security System, a formidable open source security framework for Java enterprise applications. In this first article, consultant Bilal Siddiqui introduces you to the architecture and components of Acegi and shows you how to use it to secure a simple Java enterprise application.

Securing Java applications with Acegi, Part 2: Working with an LDAP directory server
With the basics out of the way, you’re ready to discover the more advanced uses of Acegi Security System. In this article, Bilal Siddiqui shows you how to combine Acegi with an LDAP directory server for flexible, high performance Java application security. Learn how to write an access control policy and store it in ApacheDS, and then configure Acegi to interact with the directory server for authentication and authorization purposes.

Securing Java applications with Acegi, Part 3: Access control for Java objects
Bilal Siddiqui concludes his introduction to Acegi Security System by showing you how to secure access to instances of your Java classes. Learn why you need to secure access to your Java classes, how Spring creates and secures instances of your Java classes, and how to configure Acegi to incorporate class security in your Java applications.

Securing Java applications with Acegi, Part 4: Protecting JSF applications
Bilal Siddiqui continues his series by showing you how to use Acegi to secure JavaServer Faces (JSF) applications. Configure JSF and Acegi to work together in a servlet container, and explore how JSF and Acegi components cooperate with one another.

Software Development Top 30 Mistakes

Posted in Porject Management, Software Development, Software Development Manager with tags , , on Tháng Hai 20, 2008 by hadv

I have been developing software and web applications for nearly 11 years now.  Software development has come a long way since the days of Binary, Cobol, etc.  What still fascinates me about software development is the same mistakes made before, are still made today.  Below are the top 30 Mistakes that are made within the software development process.  It’s amazing to see that none of these have anything to do with the language itself.

  1. Not understanding the user’s needs. Lack of user input, or not even asking.
  2. Underestimating the size of the project.
  3. Rushing through the planning stage, or avoiding the planning all together.  Code first, plan later! BAD!
  4. Not testing early enough, often, or at all!  Make it a habit!
  5. Choosing the “Cool” methodology at the time, vs. one that has worked in the past. Which leads into my next point…
  6. Not using a methodology.
  7. Letting a software developer run the software development project.
  8. Bored, unmotivated team!  You have to motivate your developers!  If you can’t motivate, don’t bother trying to lead.  Your team will fall asleep, literally.
  9. Planning on catching up later.  You won’t… don’t even think it!
  10. Non Source Control!  Ouch.. not good people… and no, just installing a software package is not it…
  11. Deciding to switch your development tools when you’re already into the project.
  12. Allowing feature creep.  Just say NO!  Everyone will be happier in the end.
  13. Omitting necessary tasks to shorten the project plan.  Really, what’s the point of doing this?
  14. Insufficient management controls in the development project.
  15. Lack of high level business sponsorship.
  16. Adding people at the end of the project to “speed things up”.  You will only slow things down…
  17. No unit testing.  Heck if you can do it, use Visual Studio Team Foundation Server and set up some automated testing nightly.
  18. Stressed out software developers.  If you have managed to perform even one or two of these software development mistakes, you will have a stressed out bunch of programmers to deal with!
  19. Lack of error handling.
  20. “Off by one” errors.  These happen a lot during the software development process.. *sigh*.
  21. Typos…  Just use option strict and explicit please..  during one software development project, which I was on as a consultant, they were getting ridiculous amounts of errors everywhere… turned out the developer couldn’t spell and would declare variables with incorrect spelling.. no big deal, until you use the correct spelling when you’re assigning a value to it…  and  you had option explicit off.  Ouch to them…
  22. No understand the deployment or hardware the software is to be installed on.  Ohhhh it’s for a Macintosh… lol.  Well hopefully not that bad, but you get the point.
  23. No naming style or code conventions.  Honestly it doesn’t matter what you use… as long as you are consistent with the rest of the team, and hopefully at least yourself.
  24. Using global variables everywhere.  These are NOT your friend and hog memory like nothing you have ever seen before!
  25. Not asking for help at all during the software development process.  If you’re stuck, don’t fight with it for hours on end!  Ask for help!
  26. Not commenting your code.
  27. Hogging all information to yourself.  You think you’re more valuable this way?  You’re actually not and there is a plan brewing to get you kicked off the development project, and possibly out of the company.  You might want to brush up your sign “Will code for pizza!”.
  28. Performing database operations at the application layer instead of the database layer. Not only is this putting the processing juice on your application instead of your server, but you have put your database at risk of data integrity issues, and getting bad data!  Some of my hipster cool friends are always saying “It’s alllll good”, well, if your database can be caught saying this… and If everything looks good to your database, then you should be worried.  It is NOT all good!
  29. Not validating your data! Yikes…  Yes.. let’s just assume all the data is perfect! NOT!
  30. No load testing.  What.. This is supposed to run on 1,000 user’s machines through Citrix?  Interesting… Shouldn’t be an issue! lol… NOT.

Software development is tricky enough!  Make it easier on yourself by ensuring you do not make any of these mistakes.  Although it seems like a simple list of things not to do, it can make your life so much easier! By the way, while you’re here, check out our competition to win a free iPod, we are trying to get a software development blog as the number 1 site on Technorati!  All you have to do is add this blog as a favorite, and we will pick a winner as soon as we are number 1! Wouldn’t it be cool if the number 1 Technorati Blog was a software development blog with real content instead of “Boing Boing”, or “How To Make Money Online”?  Help me out!

The One Minute Software Development Manager

Posted in Porject Management, Software Development, Software Development Manager with tags , on Tháng Hai 20, 2008 by hadv

Being a Software Development Manager is a great job, if you are the right person for the job.  You have to have a real passion for technology and leadership to excel in this role.  I have spent the better part of the last 5 years studying leadership and software development, and have really enjoyed the journey.  Below are some of the key things I try and focus on day to day as I interact with my team.  Hopefully some of these points can help you!

Set Clear Goals

Setting clear goals is a key role of a Software Development manager.  This means that just telling your team “Can you get project xyz done by Friday, thanks!” is not enough, in fact, it’s useless!  You need to be able to clearly define the goal, and then describe the goal to your team in beautiful clarity!  This is done both on paper, and in meetings for visualization of the goal.  The clearer you can make the goal to your team, the more likely they will be to achieve the goal, and surpass it!  Most goals are made up of mini-goals, or mini steps if you will.  Once you have clearly defined the goal, you need to be able to setup the game plan for the goal, filling in the steps to get the goal achieved.  Once your goal is defined in minute detail, you are set!

Lead By Example

There is nothing worse than working for a manager that barks orders all day long, and yet is never around when you need them.  If you expect your team to come in on time and be totally devoted to the job, projects, and goals at hand, you have to be the most on time, focused individual of the team.  If you expect your team to take amazing meeting minutes, keep meetings focused, and send awesome project status reports, then you need to ensure you are the best meeting minute taker on the team, creating action item reports, and detailed, easy to read, meeting minutes.  During crunch time in a project, you need to not only have people are willing to come in on weekends, and put in the extra effort, you need to be the main resource available during these times!  You need to practice what you preach, set examples, and share in all the hardships.  Nobody wants to work for a manager that just wants to revile in his teams accomplishments, without actually helping the accomplishment happen!

Set Clear Direction and Vision

As a leader in your organization, your main goal should be to set the vision for the team, and do it in a clear and concise way!  It’s not enough to simply send an email that says “Our vision is to create great bug free software fast!” that is pretty much useless.  What you need to do is make your team live, breath, and act the vision.  You need to be able to energize your team to follow the vision that you create, and have a clear roadmap on how each member of the team is helping the vision take shape.  You also need to be up to speed with the rest of company, and be ready to update the team vision when it’s necessary.  Especially in the current speed of the business world, you need to be ready to react, and move that ship in another direction when needed.

Motivate Your Team

Motivation is key.  Nobody wants to work for someone that does not motivate them.  But how do you motivate a team.  It is actually easier said than done.  Take interest in your team, learn about your team, involve them in decision making and make them feel special.  Listen to your team when they have something to say.  When they come to your door and want to talk, always make time for them.  Have a lot of energy, get your sleep, eat healthy, and exude energy at every meeting, and every interaction.  You need to connect with every person on your team in a different way.  See, different people are motivated by different things.  If you get to know them on a personal level, you will find out exactly what makes them tick, and how you can make them happy, and motivated.  The more your team is motivated, the higher the retention of the individuals, and the more they will be able to contribute to your organization.

Focus On What Is Important

One of the single most important things you can do as a Software Development Manager is focus on what is important.  There will be distractions coming at you and your team on a daily basis.  You need to have the ability to quickly and easily avoid these distractions and lead your team to the important tasks at hand.  Your team needs a beacon of light, a light house.  You are the lighthouse of the team.  Your team could be the most powerful, smart, energetic team on the planet, but if you are not focusing them on what is important, they will fail!  The effort that your team puts into the job is very important, but if they are putting all their time and effort into solving the wrong problem, or the wrong problem the right way, they are wasting their time!

Be the Most Positive Member of the Team

Negativity kills!  Both literally and scientifically!  Negative thoughts and emotions have been proven to cause your immune system to weaken, and a big contributor to disease and death.  Is it any shock that this same attitude in the work place slows down projects, and causes more bugs in software than are necessary!  There are certainly times when feedback and criticism needs to be given to projects and teams, however there is a right way and a wrong way to do this.  Think about this for a second:  Why are people drawn to leaders in the first place?  Because of their negativity?  No.  It is because of their ability to look at negativity and challenges straight on and be extremely positive, and able to find solutions.  Great leaders add life to projects through their positive attitudes, and make teams achieve things that other, even more experienced teams, could never dream of achieving.

Be Decisive and Action Oriented

In order to be a great Software Development Manager, you need to have the ability to think carefully, and make decisive decisions quickly.  You need to be able to take action and carry out the decisions you have made without looking back.  While you are taking action, you also should not have your blinders on, and should be able to ask for feedback every step of the way.  Should the feedback be negative, or not the result the wanted, you have to be quick to change direction if needed, and try a different approach.

Provide the Best Tools

Providing your team with the best tools available not only makes them more productive, and makes your team enjoy their jobs more by having cool toys, it also tells your team that you know their time is valuable!  It shows your team indirectly that you realize that their time is precious, and that they are great assets to the team that cannot be wasted.

Provide the Best Hardware

How long does it take your developers to build their applications, debug, and run multiple tools they run?  Do they have one monitor that they are forced to cram all of their applications on to, and switch between applications all the time to see what one has for output?  How much are you paying them, and how bored are they getting wasting their time with this?  Do everyone a favor, including the company you work for and make sure they have the best hardware you can buy.  Especially with the cost of hardware these days, there is no excuse to waist hours a week for no reason, to save a few hundred bucks.

Trust Your Team and Their Judgement

Everyone on your team has been selected for a reason.  If you are not able to trust them and their judgement, they should not be on your team.  The reason you hire people that are experts in certain areas is so that you can trust them, and because they are just that, experts in their area.  I’m not suggesting that you just let a new person run the show and trust them instantly that would definitely be a huge mistake.  But as a manager you should get to know your team really well over time, and be able to know who are your experts, which areas they are experts in, and when you can, or cannot trust their judgment. For example if you have a masterful DBA working for you, that has built thousands of database designs in his career, would you go sit by him and micro-manage him and tell him what to do, and where to add index’s and how you would like the database structured?  Of course not… So why do so many managers insist on micro-managing?

Be the Coach

I’ve always viewed myself as the coach of the team, and not a manager. You need to be able to find the right talent, and keep them interested.  As a coach you have to be ready to make the plays, and provide feedback on the last period of play!  What was done wrong, what was done right?  Get to the point quickly, give the feedback, make the changes, and try again if there were mistakes made.  If things are going well, still provide feedback and coaching!  You always want to be improving the team!  You want to try and get your team running to its fullest potential.

So there you have it! My One Minute Software Development Manager guide to running a Software Development team!  Good luck, and enjoy the journey!

How To Finish A Big Software Project And Be The Hero

Posted in Porject Management, Software Development with tags , , on Tháng Hai 20, 2008 by hadv

 

We’ve all been there! The huge beast software project that just won’t end/die. In fact Microsoft is constantly getting themselves into this trouble. Vista, SQL Server, XP, all became these huge projects, that in the end, had to have massive features cut, and new leaders appointed to save the day and ship products! At the end of the day, if you are constantly building and building, and never shipping, you’re sunk! How do you get a big software project out of the water and become the software development hero? I’ll tell you how…First, a little history to how the big nasty project starts! A huge software development project is dreamed up to solve some complex problem. Great, that’s what software is all about! But things start going bad right on day one! How?Well, the managers and executives decide that they are going to plan every detail of the software project to the most minute detail. They then assign a project manager to manage all the developers and let them start building each piece independently one-by-one. A few weeks before shipping, the project managers try and combine everything, and all is well right? Wrong… Disaster! The project is delayed! Days pass, weeks, months, years! What the *beep* just happened here! What to do?

It’s Like Building A Building

Have you ever seen the construction of a building? Does everyone go into their own little silos and build their own thing? No! How is a skyscraper built? First lay the foundation, then put in floors, with the elevator shafts, then build floor after floor, then the interior, etc. Could you imagine what would happen if every piece was built in a different site, and then later everything was dropped off at the construction site to be assembled? Even if you had the best plan to assemble everything together, you would have problems! Things wouldn’t fit and would have to be re-done, architects would change their minds, pieces would be missing, and the building would look like a bunch of match sticks!

Be The Software Hero, Finish That Project

Does your software project feel like a disaster waiting to happen? Is it already a disaster? Are you ready to get the software project on track? Here we go…

  1. Source Control
    Do you have a source control system? If you don’t, that is a major problem! Get one ASAP. Without source control you might as well go play Russian roulette. You can’t rollback changes, you have no backups of your source code, you have no history, and it will be nearly impossible to set up proper continuous integration!
  2. Continuous Integration
    Do you have a continuous integration server setup? You know how every time you check in code, and you get the build master to build your code, everything blows up? That’s because he is only making builds when told, and this is probably not often, let alone every time someone checks in any code. Continuous Integration will automatically build your project, and give you the results of the build. You can even add Unit Tests, Coding Standards Tests, etc. But let’s keep it simple to get you on track!
  3. Bug Tracking System
    Without a bug tracking system you have no way of knowing where the quality of your software stands easily. At any time you should be able to see which features are being built, tested, approved, troublesome, etc. If you are relying on excel lists or written notes, invest the money in a bug tracking system as soon as possible!
  4. Patching System
    I’m not going to get into installer issues here, but you need a patching system. You do not want to deploy installs upon installs to your testers.
  5. Disable Untested Features
    Turn off every feature in your application that has not been completely bug tested and approved by your users. If your project is in trouble, you have hundreds of features implemented at 80%, and you probably think they are at 90% – 95%, but they aren’t.
  6. List Major Features
    Make a list of all the major features that are involved in the software project. Start at a very high level. This is the key step to start turning around the project. You are going to pick your battles here, small, winnable battles, instead of fighting a never ending battle with thousands of features.
  7. List Top 20% of Major Features
    Ok so you have a list of all the major features, now take 20% of the high level features and make another list of those. These are the features that must be implemented for a great pre-release version of your software.
  8. Detail Out Top 20%
    For the 20% List, make another detailed list of every feature that needs to be implemented in order for these 20% items to be completed. Rank these features by importance. I like to choose the most complex ones first, and end with the easier ones. This makes it easier to know if you are on track, as finishing easy features first, won’t really give you any indication as to how much longer you are going to take.
  9. Plan The Week
    Carefully figure out which of these features you can complete in the next week. Assign out features to developers on the team. When you assign them, try and keep similar features together. Make sure everyone is checking in code regularly. When they check in, if they break the build, they must fix their build immediately!
  10. Create Branch
    Using the source control system you chose, create a branch. Your goal here is to create a branch, label it as the testing version, and then release a patch in the next step. Next you start working on the items for the next week, while your testers test.
  11. Build Release for Testers
    Get your Build Master into high gear; have him build a patch for your internal quality assurance team.
  12. Testers Take Flight
    Hopefully you have a Quality Assurance Team, if you don’t start with at least one person and get them setup with the Bug Tracking System. Get them to get the patch as soon as it’s available, and get at the testing! By the way, if you can include customers or end users in your quality assurance team, do it! As soon as your testers find any bugs, issues with implementation of features, etc. make sure they report them to the developers! If you have a good bug tracking system, the system should automatically email the developers when your testers give feedback or change the status of bugs.
  13. Software Developers Work on Trunk
    While your testers test, your developers keep working on next week’s items. As bugs come up, they go back to the branch, resolve the issues, and go back to Trunk Development.
  14. Approve Patch
    Your testers have completed the testing? Everything looks good? AWESOME! You have just completed your first set of features that are now ready to be installed! Technically, if you have followed the procedures outlined above, a customer or client tester should be able to install this software, get the patch, and use it!
  15. Continue Steps 9 to 14
    Continue your efforts over and over until you get the 20% done, hopefully this is not as far away as you think!

Your goal is to focus on small features, get them done, and send out a release for testers. This is a huge shift from trying to complete 100% of your bug ridden huge project.

Your team will be extremely motivated to be releasing workable software every week! They will actually speed up, and the whole project will start gaining unbelievable momentum!

When testers find bugs, your developers will fix them faster because the code they wrote is fresh in their minds! If features need to be tweaked and changed, it gets caught early, and changes are much more fluid!

Your business users will start seeing results! They will in turn give you more resources, better tools, and more respect! The shiny happy people will hold hands!

Is there a lot to do? It depends in how much of a mess your development lifecycle is. If you have nothing of the above setup, you are going to have a tough time, but if you focus and execute quickly, you should have no problem’s setting up the ideal environment quickly.

Enjoy being the Software Development Hero!

Tomcatのセキュリティとリスクの基本

Posted in Java, LightWeight J2EE, Security, Tomcat on Tháng Hai 4, 2008 by hadv

前回までで、Tomcat 6系に関する機能や設定、運用といったところに触れてきました。今回と次回は2回に分けて、いよいよTomcatを運用していくに当たってのセキュリティ面に着目していきたいと思います。

Tomcatのセキュリティとリスクの基本

.NET開発者のためのDI&AOP入門(前編)

Posted in .NET, AOP, DI, Seasar on Tháng Hai 4, 2008 by hadv

 “DI”や“AOP”というキーワードを耳にしたことがあるだろうか。これらのテクノロジは、.NET技術者にはまだまだ普及していないのが現状 だが、Java開発での長年の利用結果から見ても開発生産性を飛躍的に高めてくれるテクノロジであることは間違いなく、.NET開発でも必ず役立つもので あり、むしろ使わない手はない。従って、できるだけ多くの.NET開発者にこれらのテクノロジの良さを知っていただき、有効に活用していただきたいと筆者 は考えている。

 そこで本稿では2回にわたり、前編でDIを、後編でAOPを紹介していきたいと思う。本稿を通して.NET開発におけるDIとAOPの有効性と可能性を感じ取っていただければ幸いである。

Test-Driven Development in .NET

Posted in .NET, C# on Tháng Một 14, 2008 by hadv

Table of Contents

Introduction

Although developers have been unit testing their code for years, it was typically performed after the code was designed and written. As a great number of developers can attest, writing tests after the fact is difficult to do and often gets omitted when time runs out. Test-driven development (TDD) attempts to resolve this problem and produce higher quality, well-tested code by putting the cart before the horse and writing the tests before we write the code. One of the core practices of Extreme Programming (XP), TDD is acquiring a strong following in the Java community, but very little has been written about doing it in .NET.

Implementing IDisposable and the Dispose Pattern Properly

Posted in .NET, C# on Tháng Mười Hai 30, 2007 by hadv

Introduction

In most modern programming languages, memory is allocated on the heap or the stack. Memory allocated on the stack stores local variables, parameters, return values, and is generally managed by the operating system. Memory allocated on the heap is handled differently by different programming languages. In C and C++, memory must be managed manually, while in C# and Java memory is managed automatically.

Even though manual memory management is easier for the language runtime, it adds complexity for the programmer which can lead to bugs and coding errors due to improper memory management and object lifecycle maintenance.

Automatic memory management is known as garbage collection. Even though garbage collection is harder for the language runtime, it reduces the complexity for the programmer and helps reduce the number of bugs and coding errors caused by manual memory management.

 Implementing IDisposable and the Dispose Pattern Properly

Thế giới quan – chiếc la bàn định hướng cuộc sống

Posted in Life with tags on Tháng Mười Hai 28, 2007 by hadv

Giới thiệu

- Hành trang cuộc sống của mỗi người luôn luôn cần tới những tri thức, trí tuệ sâu sắc. Thế giới quan là thứ không thể thiếu được trong hành trang trí tuệ ấy của mỗi người. Nó là cái cần phải được từng người tự học hỏi, chăm lo, đổi mới để có thể nhìn, hiểu và làm theo những luận điểm tổng quát góp phần như một chiếc la bàn định hướng cuộc sống, làm cho cuộc sống thêm hiệu quả, hạnh phúc và thành đạt.

- Bài viết này làm rõ khái niệm thế giới quan, các thành phần của nó, ý nghĩa/ vai trò của nó, nguồn tư liệu để xây dựng thế giới quan và nhu cầu xây dựng một thế giới quan mới hiện đại.


Suy nghĩ triết lý và Thế giới quan là gì?

- Vượt trên việc suy nghĩ những vấn đề “ăn để sống”, “mối lợi vật chất” hằng ngày, con người còn “vươn tâm hồn mình” suy ngẫm thêm những vấn đề cuộc sống sâu sắc khác như “Ta nên sống vì cái gì?”, “thực ra hạnh phúc là gì?”, “làm sao để có được hạnh phúc lâu bền?”, “nên bắt đầu làm gì để cải thiện được cuộc sống hàng ngày tốt hơn?” hay những câu hỏi triết lý lớn như triết gia Kant đã nêu ra cho cuộc đời: “Tôi có thể biết gì? Tôi cần phải làm gì? Tôi có thể hy vọng vào cái gì? Tôi là ai?”. Những câu hỏi này hoàn toàn mang nội dung cụ thể gắn với thực tế đời sống, có giá trị cải thiện chất lượng sống. Tuy nhiên, không ít người cảm tưởng rằng những điều quan tâm triết lý đó là thừa, xa rời điều họ thường ngày quan tâm.

- Cuộc sống của mỗi người cũng như xã hội ngày một mở rộng nên hiểu biết, mối quan tâm, cảm nhận, suy nghĩ và hoạt động của họ ngày một rộng lớn hơn đòi hỏi họ cần có hiểu biết về thế giới, con người, mối quan hệ thế giới với con người, con người với thế giới như một chỉnh thể có trật tự, còn gọi là bức tranh về thế giới hay thế giới quan. Nó là một tổng hợp, suy tư hữu ích về đời sống tinh thần phong phú, sâu sắc cho con người.


Các vấn đề lớn của thế giới quan

Thế giới quan là một chỉnh thể luận điểm có trật tự, tổng hợp, có tính hệ thống, phức hợp cả nhân tố lý tính, cảm nhận, cảm xúc và thấu hiểu thế giới, con người, những luận điểm sống tích cực cho con người.

Thế giới quan bao gồm những thành phần cơ bản sau được liên kết thành một tổng thể mạch lạc, thống nhất:

o Hệ thống tri thức về thế giới. Để trả lời được thế giới quan dựa trên mọi thành tựu đạt được, được xác thực của khoa học.

§ Câu hỏi về bản thể học: Thế giới là gì? Những gì đang diễn ra trên thế giới này? Bản chất thế giới này là gì? Thế giới được hình thành và vận động ra sao? Thành phần và hình thức tồn tại của nó như thế nào?

§ Câu hỏi về giải thích nguồn gốc: Tại sao thế giới lại vận động theo cách này mà không theo cách khác? Thế giới và ta tuân theo các nguyên lý phổ quát nào?

o Câu hỏi về Nhận thức luận: về tri thức, cảm xúc của con người về thế giới và vị trí của mình trong đó. Kiến thức là gì? Chân lý là gì? Có chân lý khách quan, tuyệt đối không? Chúng ta sẽ xây dựng hình ảnh thế giới của mình như thế nào? Một vị trí như thế nào trong thế giới thuộc về con người?, Mối quan hệ của con người với thế giới ra sao?, Con người có những lý tưởng nào?, Đặc thù của ý thức và cảm xúc của con người ở chỗ nào?

o Câu hỏi về giá trị/ luân lý học: Quan điểm, tư tưởng thông thái về giá trị, về nguyên tắc sống, các định hướng mục đích và các chuẩn mực phối hợp của đạo đức, pháp luật và thẩm mỹ. Đó là nhân tố có ý nghĩa lớn lao trong việc giải quyết phần lớn những vấn đề và nhiệm vụ chủ yếu của đời người. Tại sao chúng ta cảm nhận thế giới theo cách này? Những giá trị và mục đích chúng ta theo đuổi là gì? Thiện/ ác là thế nào? Chúng ta đánh giá thực tế toàn cầu và vai trò của loài người ở đó như thế nào? Con người đã đặt ra cho mình những mục đích sống và các phương tiện để thực hiện mục đích như thế nào? Liệu nó có tuân theo những quy luật phát triển khách quan của thế giới, những nhu cầu, lợi ích và khả năng khách quan của họ không?

o Câu hỏi về dự đoán tương lai: Tương lai nào mở ra cho mỗi người và cả loài người? Chúng ta sẽ chọn các tương lai có thể bằng các tiêu chí nào? Bằng cách nào họ thể hiện được sự thống nhất giữa con người và thế giới, đã hiểu được những triển vọng của mình, tin tưởng vào bản thân mình, vào tương lai của nhân loại?

o Câu hỏi về hành động: Chúng ta sẽ phải hành động như thế nào? Theo các cách khác nhau chúng ta có thể ảnh hướng tới thế giới và biến đổi nó như thế nào? Chúng ta nên sắp xếp các hành động của mình theo nguyên tắc nào?


Vai trò của thế giới quan

Thế giới quan đóng vai trò nhân tố sống động của ý thức cá nhân, giữ vai trò chỉ dẫn cách thức tư duy và hành động của cá nhân. Nó đồng thời cũng thể hiện lý luận và khái quát hóa các quan điểm và hoạt động của nhóm xã hội. Mỗi cá nhân cũng luôn mong muốn tiếp nhận những thế giới quan khác, làm phong phú thế giới quan cho mình, góp phần điều chỉnh định hướng cuộc sống.

Xuất phát từ lập trường, biện giải thế giới quan đúng đắn, con người có thể có được những cách giải quyết vấn đề đúng đắn do cuộc sống đặt ra. Ngược lại, xuất phát từ lập trường sai lầm, con người khó có thể tránh khỏi hành động sai lầm.

Khi giải quyết những vấn đề cụ thể của thực tiễn, sớm muộn người ta vấp phải những vấn đề chung, cần đến sự đóng góp của thế giới quan làm cơ sở định hướng giải quyết vấn đề cụ thể. “Một tập hợp những sự kiện mới càng rối rắm bao nhiêu, các tư tưởng mới càng nhiều hình nhiều vẻ bao nhiêu thì nhu cầu phải có một thế giới quan liên kết lại càng cảm thấy trở nên bức thiết bấy nhiêu” (M. Plank)

Ban đầu, mỗi cá nhân phát triển tinh thần đến một mức độ nào đó đều tìm cách trả lời các câu hỏi triết lý riêng của mình một cách tự phát, nghiệp dư. Đó là dấu hiệu “triết gia” ở mức độ nào đó (thậm chí họ không biết cả đến từ “triết học” hay “thế giới quan”). Dần dần, do động chạm đến những vấn đề quan tâm nhất của con người, xã hội, nhân loại mà xuất hiện nhiều người có phẩm chất vĩ đại, say mê sáng tạo những học thuyết và hệ thống thế giới quan đồ sộ, sâu sắc, độc đáo và phổ quát một cách thức hết sức chuyên nghiệp. Họ được gọi là triết gia hay là những người theo đuổi sự khôn ngoan. Họ là những người để lại những quan điểm mang dấu ấn lớn, đánh thức sợi dây tâm hồn của nhiều thế hệ tiếp theo.

Tuy nhiên, việc chuyên môn hóa xây dựng thế giới quan cũng có nhược điểm. Nó làm gia tăng khoảng cách giữa nhà chuyên môn – triết gia với người bình thường. Do vậy, do sự biến đổi nhanh và thay đổi mặt bằng triết lý chung, công chúng đã bị cách triết gia gạt khỏi đối tượng truyền đạt dẫn tới có sự xa cách, khó hiểu cho đại chúng. Vì vậy, xã hội và mỗi người cần quan tâm xây dựng và phổ biến một thế giới quan đúng đắn. Điều này sẽ mang một ý nghĩa vô cùng quan trọng giúp cho mỗi người trở thành thực thể tự do và sáng tạo thực sự, nhân văn thực sự.



Nguồn tư liệu phục vụ xây dựng thế giới quan

Việc xây dựng thế giới quan được coi là nỗ lực chung xem xét đến tối đa tất cả các khía cạnh kinh nghiệm, hiểu biết thường ngày của tất cả mọi người. Theo thời gian, xã hội loài người đã xây dựng được cho mình các hệ thống tinh thần phong phú, khác biệt nhau nhưng bổ trợ lẫn nhau, đóng vai trò làm “suối nguồn” cung cấp những câu trả lời thế giới quan. Các hệ thống tinh thần ấy là:

- Triết học phương Tây: thiên hướng duy lý, sử dụng luận cứ và tư biện của lý trí, kể cả việc phê phán lý trí ấy. Đối tượng của nó rất rộng, thường hướng ngoại, tách biệt đối tượng để đi sâu nhằm hiểu biết bản chất từ tự nhiên đến xã hội, tư duy để nhận thức cho khách quan… Luận điểm triết học được thể hiện qua các khái niệm, mệnh đề, biểu thức logic để đối tượng, bản chất được mô tả rõ ràng, thống nhất nhau và ngày càng phong phú, chi tiết hơn.

- Minh triết phương Đông: thiên hướng sử dụng trực giác, tổng thể, hướng nội để đi thẳng vào trả lời những vấn đề về nhân sinh quan, lối sống: xã hội, chính trị, đạo đức, quan hệ người người, tâm linh… Luận điểm minh triết được thể hiện qua hình ảnh nghệ thuật, giàu tính ẩn dụ, liên tưởng, hình ảnh, ngụ ngôn đa nghĩa nhưng rất dễ gây nhập nhằng.

- Thành tựu khoa học:hệ thống tri thức có hệ thống, sử dụng ngôn ngữ đặc thù, chặt chẽ, đa số được kiểm chứng, phát triển dựa trên những thành tựu không ngừng của khoa học tự nhiên, khoa học xã hội.Thành tựu khoa học giúp cho chúng ta có thế giới quan một cách tin cậy, vững chắc hơn. Tuy nhiên, do sự phân chia liên tục lĩnh vực nghiên cứu mà tri thức khoa học ngày một xa rời những câu hỏi mang tính tổng hợp về số mệnh tiền định của cá nhân, nhân loại, về những giá trị cao cả của nhân loại.

- Tôn giáo học: dựa trên niềm tin về uy quyền tôn giáo (siêu việt) đối với vật chất và tinh thần. Mọi sự lý giải thế giới quan đều có can dự bởi quan hệ tới Chúa và sự sáng tạo tối cao của Chúa.


Triết học – hạt nhân quan trọng của thế giới quan

Triết học là dạng thức quan trọng nhất đóng vai trò trung tâm cho thế giới quan. Những vấn đề triết học là những vấn đề có mối liên hệ cao nhất, thường hằng của lý tính nhân loại, đó là những vấn đề về số mệnh, tiền định của nhân loại, về chính lý tính và những giá trị cao cả của con người. Sống vì cái gì và sống ra sao? Làm thế nào để cuộc sống thực sự trở nên sáng suốt và hạnh phúc, cũng như làm thế nào để sống cho ra sống?

Những vấn đề đó không thể giải quyết được một cách triệt để bởi vì mỗi thời đại chúng lại được đặt ra trước con người một cách mới mẻ. Mỗi bước tiến của lịch sử nhân loại, mỗi thành quả của kinh nghiệm xã hội, mỗi mốc đánh dấu sự tiến bộ trong lịch sử khoa học đều mở ra trước lý tính triết học những giới hạn hiện thực mà trước đó chưa được biết tới, tạo ra khả năng phát hiện ngày càng nhiều luận cứ quan trọng trong tranh biện triết học. Bởi vậy, Thế giới quan triết học có thể đồng nghĩa với sự phản tư văn hóa của một dân tộc, một thời đại.


Nhu cầu một thế giới quan mới hiện đại

Mỗi khi xã hội, thời đại có những bước chuyển biến lớn (cùng một lúc chúng ta có nhiều bước chuyển: công nghiệp hóa-hiện đại hóa, tin học hóa, tư hữu hóa, dân chủ hóa, toàn cầu hóa, nhân đạo hóa…) thì thế giới quan lại thể hiện tầm vóc lớn lao của nó. Chúng ta cần 1 thế giới quan đúng đắn, khoa học và cách mạng, phù hợp hơn với bối cảnh mới, bám sát hiện thực mới, bám sát con người hiện đại.

Thế giới quan của mới sẽ phải mang những đặc điểm:

- Bám sát nhiều lĩnh vực thực tiễn mới, tích hợp nhiều nguồn tư liệu phục vụ thế giới quan, tri thức khoa học công nghệ. Đảm bảo đầy đủ, rõ ràng, dễ hiểu và tránh lẫn lộn, mâu thuẫn

- Kế thừa, phát huy những tinh hoa của thế giới quan duy vật. Khoa học hệ thống và điều khiển học lớn mạnh và trở thành trung tâm của nền khoa học và dẫn dắt thành tựu khoa học, công nghệ và trở thành nền tảng của văn hóa nhân loại. Khoa học hệ thống – điều khiển học là lựa chọn tốt làm công cụ hữu hiệu cung cấp phương thức tư duy mới – tư duy hệ thống hợp nhất kiến thức khoa học, nghệ thuật đa ngành với nhau.

- Cung cấp những câu trả lời tốt nhất về những vấn đề cơ bản của thế giới quan.

- Phù hợp sự đa dạng, phức tạp, tính mở, sự tiến hóa, tương tác và thông tin giữa các hệ thống

Follow

Get every new post delivered to your Inbox.